github.com/jaylevin/jenkins-library@v1.230.4/resources/metadata/cnbBuild.yaml (about) 1 metadata: 2 name: cnbBuild 3 description: Executes Cloud Native Buildpacks. 4 longDescription: |- 5 Executes a Cloud Native Buildpacks build for creating Docker image(s). 6 **Important:** Please note, that the cnbBuild step is in **beta** state, and there could be breaking changes before we remove the beta notice. 7 spec: 8 inputs: 9 secrets: 10 - name: dockerConfigJsonCredentialsId 11 description: | 12 Jenkins 'Secret file' credentials ID containing Docker config.json (with registry credential(s)) in the following format: 13 14 ```json 15 { 16 "auths": { 17 "$server": { 18 "auth": "base64($username + ':' + $password)" 19 } 20 } 21 } 22 ``` 23 24 Example: 25 26 ```json 27 { 28 "auths": { 29 "example.com": { 30 "auth": "dXNlcm5hbWU6cGFzc3dvcmQ=" 31 } 32 } 33 } 34 ``` 35 type: jenkins 36 params: 37 - name: containerImageName 38 aliases: 39 - name: dockerImageName 40 type: string 41 description: | 42 Name of the container which will be built 43 `cnbBuild` step will try to identify a containerImageName using the following precedence: 44 1. `containerImageName` parameter. 45 2. `project.id` field of a `project.toml` file. 46 3. `git/repository` parameter of the `commonPipelineEnvironment`. 47 4. `github/repository` parameter of the `commonPipelineEnvironment`. 48 If none of the above was found - an error will be raised. 49 scope: 50 - GENERAL 51 - PARAMETERS 52 - STAGES 53 - STEPS 54 - name: containerImageTag 55 aliases: 56 - name: artifactVersion 57 type: string 58 mandatory: true 59 description: Tag of the container which will be built 60 scope: 61 - GENERAL 62 - PARAMETERS 63 - STAGES 64 - STEPS 65 resourceRef: 66 - name: commonPipelineEnvironment 67 param: artifactVersion 68 - name: commonPipelineEnvironment 69 param: git/commitId 70 - name: containerRegistryUrl 71 aliases: 72 - name: dockerRegistryUrl 73 type: string 74 mandatory: true 75 description: Container registry where the image should be pushed to 76 scope: 77 - GENERAL 78 - PARAMETERS 79 - STAGES 80 - STEPS 81 resourceRef: 82 - name: commonPipelineEnvironment 83 param: container/registryUrl 84 - name: buildpacks 85 type: "[]string" 86 description: List of custom buildpacks to use in the form of '$HOSTNAME/$REPO[:$TAG]'. 87 scope: 88 - PARAMETERS 89 - STAGES 90 - STEPS 91 resourceRef: 92 - name: commonPipelineEnvironment 93 param: container/buildpacks 94 - name: buildEnvVars 95 type: "map[string]interface{}" 96 description: | 97 Map of custom environment variables used during a build. 98 Example: 99 ```yaml 100 buildEnvVars: 101 foo: bar 102 ``` 103 scope: 104 - PARAMETERS 105 - STAGES 106 - STEPS 107 - name: path 108 type: string 109 description: | 110 Glob that should either point to a directory with your sources or one artifact in zip format. 111 This property determines the input to the buildpack. 112 scope: 113 - PARAMETERS 114 - STAGES 115 - STEPS 116 - name: projectDescriptor 117 type: string 118 description: | 119 Relative path to the project.toml file. 120 See [buildpacks.io](https://buildpacks.io/docs/reference/config/project-descriptor/) for the reference. 121 Parameters passed to the cnbBuild step will take precedence over the parameters set in the project.toml file, except the `env` block. 122 Environment variables declared in a project descriptor file, will be merged with the `buildEnvVars` property, with the `buildEnvVars` having a precedence. 123 124 *Note*: The project descriptor path should be relative to what is set in the [path](#path) property. If the `path` property is pointing to a zip archive (e.g. jar file), project descriptor path will be relative to the root of the workspace. 125 126 *Note*: Inline buildpacks (see [specification](https://buildpacks.io/docs/reference/config/project-descriptor/#build-_table-optional_)) are not supported yet. 127 default: project.toml 128 scope: 129 - PARAMETERS 130 - STAGES 131 - STEPS 132 - name: dockerConfigJSON 133 type: string 134 description: Path to the file `.docker/config.json` - this is typically provided by your CI/CD system. You can find more details about the Docker credentials in the [Docker documentation](https://docs.docker.com/engine/reference/commandline/login/). 135 scope: 136 - PARAMETERS 137 secret: true 138 resourceRef: 139 - name: commonPipelineEnvironment 140 param: custom/dockerConfigJSON 141 - name: dockerConfigJsonCredentialsId 142 type: secret 143 - type: vaultSecretFile 144 name: dockerConfigFileVaultSecretName 145 default: docker-config 146 - name: customTlsCertificateLinks 147 type: "[]string" 148 description: List containing download links of custom TLS certificates. This is required to ensure trusted connections to registries with custom certificates. 149 scope: 150 - PARAMETERS 151 - STAGES 152 - STEPS 153 - name: additionalTags 154 type: "[]string" 155 description: List of tags which will be pushed to the registry (additionally to the provided `containerImageTag`), e.g. "latest". 156 scope: 157 - PARAMETERS 158 - STAGES 159 - STEPS 160 - name: bindings 161 type: "map[string]interface{}" 162 description: | 163 Map of bindings that should be offered to the buildpack. The type of bindings depend on the buildpack. For documentation about bindings in general see [the paketo documentation](https://paketo.io/docs/howto/configuration/#bindings). 164 165 Example: Custom maven settings.xml for the Java Buildpack 166 167 ```yaml 168 bindings: 169 maven-settings: 170 type: maven 171 key: settings.xml 172 file: path/to/settings.xml 173 ``` 174 175 inline: 176 ```yaml 177 bindings: 178 maven-settings: 179 type: maven 180 key: settings.xml 181 content: "inline settings.xml" 182 ``` 183 184 from url: 185 ```yaml 186 bindings: 187 maven-settings: 188 type: maven 189 key: settings.xml 190 fromUrl: https://url-to/setting.xml 191 ``` 192 scope: 193 - PARAMETERS 194 - STAGES 195 - STEPS 196 - name: multipleImages 197 aliases: 198 - name: images 199 type: "[]map[string]interface{}" 200 description: | 201 This parameter is only needed if `cnbBuild` should create multiple images. 202 Otherwise it can be ignored!!! 203 204 In case of multiple images, this array contains one entry for each image. That 205 entry can override any parameter from the main section, e.g. 206 207 ```yaml 208 containerImageTag: latest 209 containerRegistryUrl: docker.io/example 210 dockerConfigJsonCredentialsId: CREDENTIALS 211 multipleImages: 212 - containerImageName: java-app 213 buildpacks: 214 - "java" 215 path: "source/java" 216 - containerImageName: nodejs-app 217 containerImageTag: v1.0.0 218 buildpacks: 219 - "nodejs" 220 path: "source/nodejs" 221 ``` 222 scope: 223 - PARAMETERS 224 - STAGES 225 - STEPS 226 - name: preserveFiles 227 type: "[]string" 228 description: | 229 List of globs, for keeping build results in the Jenkins workspace. 230 231 *Note*: globs will be calculated relative to the [path](#path) property. 232 scope: 233 - PARAMETERS 234 - STAGES 235 - STEPS 236 outputs: 237 resources: 238 - name: commonPipelineEnvironment 239 type: piperEnvironment 240 params: 241 - name: container/registryUrl 242 - name: container/imageDigest 243 - name: container/imageNameTag 244 - name: container/imageNames 245 type: "[]string" 246 - name: container/imageNameTags 247 type: "[]string" 248 - name: container/imageDigests 249 type: "[]string" 250 containers: 251 - image: "paketobuildpacks/builder:base"