github.com/ouraigua/jenkins-library@v0.0.0-20231028010029-fbeaf2f3aa9b/resources/metadata/gradleExecuteBuild.yaml (about) 1 metadata: 2 name: gradleExecuteBuild 3 description: This step runs a gradle build command with parameters provided to the step. 4 longDescription: This step runs a gradle build command with parameters provided to the step.Supports execution of gradle tasks with or without wrapper.Gradle tasks and flags can be specified via 'task' or 'buildFlags' parameter. If both are not specified 'build' task will run by default. 5 spec: 6 inputs: 7 params: 8 - name: path 9 aliases: 10 - name: buildGradlePath 11 deprecated: false 12 type: string 13 description: Path to the folder with build.gradle (or build.gradle.kts) file which should be executed. 14 scope: 15 - PARAMETERS 16 - STAGES 17 - STEPS 18 mandatory: false 19 - name: task 20 type: string 21 description: A single gradle task that should be executed. If you prefer more than one, use 'buildFlags' parameter. If 'buildFlags' parameter is specified, this parameter will be ignored. 22 scope: 23 - PARAMETERS 24 - STAGES 25 - STEPS 26 mandatory: false 27 default: build 28 - name: publish 29 type: bool 30 description: Configures gradle to publish the artifact to a repository. 31 scope: 32 - STEPS 33 - STAGES 34 - PARAMETERS 35 default: false 36 - name: repositoryUrl 37 type: string 38 description: Url to the repository to which the project artifacts should be published. 39 scope: 40 - GENERAL 41 - PARAMETERS 42 - STAGES 43 - STEPS 44 resourceRef: 45 - name: commonPipelineEnvironment 46 param: custom/repositoryUrl 47 - name: repositoryPassword 48 type: string 49 description: Password for the repository to which the project artifacts should be published. 50 scope: 51 - GENERAL 52 - PARAMETERS 53 - STAGES 54 - STEPS 55 secret: true 56 resourceRef: 57 - name: commonPipelineEnvironment 58 param: custom/repositoryPassword 59 - name: repositoryUsername 60 type: string 61 description: Username for the repository to which the project artifacts should be published. 62 scope: 63 - GENERAL 64 - PARAMETERS 65 - STAGES 66 - STEPS 67 secret: true 68 resourceRef: 69 - name: commonPipelineEnvironment 70 param: custom/repositoryUsername 71 - name: createBOM 72 type: bool 73 description: Creates the bill of materials (BOM) using CycloneDX plugin. 74 scope: 75 - GENERAL 76 - STEPS 77 - STAGES 78 - PARAMETERS 79 - name: artifactVersion 80 type: string 81 description: Version of the artifact to be built. 82 scope: 83 - GENERAL 84 - PARAMETERS 85 - STAGES 86 - STEPS 87 resourceRef: 88 - name: commonPipelineEnvironment 89 param: artifactVersion 90 - name: artifactGroupId 91 type: string 92 description: The group of the artifact. 93 scope: 94 - PARAMETERS 95 - STAGES 96 - STEPS 97 resourceRef: 98 - name: commonPipelineEnvironment 99 param: groupId 100 - name: artifactId 101 type: string 102 description: The name of the artifact. 103 scope: 104 - PARAMETERS 105 - STAGES 106 - STEPS 107 resourceRef: 108 - name: commonPipelineEnvironment 109 param: artifactId 110 - name: useWrapper 111 type: bool 112 description: If set to false all commands are executed using 'gradle', otherwise 'gradlew' is executed. 113 scope: 114 - STEPS 115 - STAGES 116 - PARAMETERS 117 default: false 118 - name: applyPublishingForAllProjects 119 type: bool 120 description: If set to false publishing logic will be applied in 'rootProject' directive, otherwise 'allprojects' will be directive used 121 scope: 122 - STEPS 123 - STAGES 124 - PARAMETERS 125 default: false 126 - name: excludeCreateBOMForProjects 127 description: Defines which projects/subprojects will be ignored during bom creation. Only if applyCreateBOMForAllProjects is set to true 128 scope: 129 - PARAMETERS 130 - STAGES 131 - STEPS 132 type: "[]string" 133 - name: excludePublishingForProjects 134 description: Defines which projects/subprojects will be ignored during publishing. Only if applyCreateBOMForAllProjects is set to true 135 scope: 136 - PARAMETERS 137 - STAGES 138 - STEPS 139 type: "[]string" 140 - name: buildFlags 141 type: "[]string" 142 description: Defines a list of tasks and/or arguments to be provided for gradle in the respective order to be executed. This list takes precedence if specified over 'task' parameter 143 longDescription: | 144 Defines a list of tasks and/or arguments to be provided for gradle in the respective order to be executed. This list takes precedence if specified over 'task' parameter 145 To run command `gradle clean build -x test` , it can be achieved as follows 146 147 ``` 148 steps: 149 gradleExecuteBuild: 150 buildFlags: 151 - clean 152 - build 153 - -x 154 - test 155 ``` 156 scope: 157 - PARAMETERS 158 - STAGES 159 - STEPS 160 outputs: 161 resources: 162 - name: reports 163 type: reports 164 params: 165 - filePattern: "**/bom-gradle.xml" 166 type: sbom 167 - name: commonPipelineEnvironment 168 type: piperEnvironment 169 params: 170 - name: custom/artifacts 171 type: "piperenv.Artifacts" 172 containers: 173 - name: gradle 174 image: gradle:6-jdk11-alpine