2021-08-18 12:10:55 +02:00
metadata :
name : cnbBuild
2021-11-30 12:51:00 +02:00
description : Executes Cloud Native Buildpacks.
longDescription : |-
Executes a Cloud Native Buildpacks build for creating Docker image(s).
**Important:** Please note, that the cnbBuild step is in **beta** state, and there could be breaking changes before we remove the beta notice.
2021-08-18 12:10:55 +02:00
spec :
inputs :
secrets :
- name : dockerConfigJsonCredentialsId
2021-10-01 14:24:59 +02:00
description : |
Jenkins 'Secret file' credentials ID containing Docker config.json (with registry credential(s)) in the following format :
```json
{
"auths": {
"$server": {
"auth": "base64($username + ':' + $password)"
}
}
}
```
Example :
```json
{
"auths": {
"example.com": {
"auth": "dXNlcm5hbWU6cGFzc3dvcmQ="
}
}
}
```
2021-08-18 12:10:55 +02:00
type : jenkins
params :
- name : containerImageName
aliases :
- name : dockerImageName
type : string
2022-01-14 17:49:45 +02:00
description : |
Name of the container which will be built
`cnbBuild` step will try to identify a containerImageName using the following precedence :
1 . `containerImageName` parameter.
2 . `project.id` field of a `project.toml` file.
3 . `git/repository` parameter of the `commonPipelineEnvironment`.
If none of the above was found - an error will be raised.
2021-08-18 12:10:55 +02:00
scope :
- GENERAL
- PARAMETERS
- STAGES
- STEPS
- name : containerImageTag
aliases :
- name : artifactVersion
type : string
2021-08-26 14:26:54 +02:00
mandatory : true
description : Tag of the container which will be built
2021-08-18 12:10:55 +02:00
scope :
- GENERAL
- PARAMETERS
- STAGES
- STEPS
resourceRef :
- name : commonPipelineEnvironment
param : artifactVersion
- name : containerRegistryUrl
aliases :
- name : dockerRegistryUrl
type : string
2021-08-26 14:26:54 +02:00
mandatory : true
description : Container registry where the image should be pushed to
2021-08-18 12:10:55 +02:00
scope :
- GENERAL
- PARAMETERS
- STAGES
- STEPS
resourceRef :
- name : commonPipelineEnvironment
param : container/registryUrl
2021-09-14 16:14:50 +02:00
- name : buildpacks
type : "[]string"
2021-10-28 13:52:21 +02:00
description : List of custom buildpacks to use in the form of '$HOSTNAME/$REPO[:$TAG]'.
2021-09-14 16:14:50 +02:00
scope :
- PARAMETERS
- STAGES
- STEPS
2021-11-29 12:32:32 +02:00
resourceRef :
- name : commonPipelineEnvironment
param : container/buildpacks
2021-09-29 18:21:13 +02:00
- name : buildEnvVars
2021-11-29 12:32:32 +02:00
type : "map[string]interface{}"
description : |
Map of custom environment variables used during a build.
Example :
```yaml
buildEnvVars :
foo : bar
```
2021-09-29 18:21:13 +02:00
scope :
- PARAMETERS
- STAGES
- STEPS
2021-08-18 12:10:55 +02:00
- name : path
type : string
2021-10-28 13:52:21 +02:00
description : |
The path should either point to a directory with your sources or an artifact in zip format.
This property determines the input to the buildpack.
2021-08-18 12:10:55 +02:00
scope :
- PARAMETERS
- STAGES
- STEPS
2021-10-11 11:10:21 +02:00
- name : projectDescriptor
type : string
2021-10-28 13:52:21 +02:00
description : |
2022-02-15 15:39:14 +02:00
Relative path to the project.toml file.
2021-10-28 13:52:21 +02:00
See [buildpacks.io](https://buildpacks.io/docs/reference/config/project-descriptor/) for the reference.
2021-11-29 12:32:32 +02:00
Parameters passed to the cnbBuild step will take precedence over the parameters set in the project.toml file, except the `env` block.
Environment variables declared in a project descriptor file, will be merged with the `buildEnvVars` property, with the `buildEnvVars` having a precedence.
2021-10-28 13:52:21 +02:00
2022-02-23 19:54:59 +02:00
*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.
*Note*: Inline buildpacks (see [specification](https://buildpacks.io/docs/reference/config/project-descriptor/#build-_table-optional_)) are not supported yet.
2021-10-11 11:10:21 +02:00
default : project.toml
scope :
- PARAMETERS
- STAGES
- STEPS
2021-08-18 12:10:55 +02:00
- name : dockerConfigJSON
type : string
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/).
scope :
- PARAMETERS
secret : true
resourceRef :
- name : commonPipelineEnvironment
param : custom/dockerConfigJSON
- name : dockerConfigJsonCredentialsId
type : secret
- type : vaultSecretFile
2021-10-13 16:28:51 +02:00
name : dockerConfigFileVaultSecretName
default : docker-config
2021-10-01 13:48:24 +02:00
- name : customTlsCertificateLinks
type : "[]string"
description : List containing download links of custom TLS certificates. This is required to ensure trusted connections to registries with custom certificates.
scope :
- PARAMETERS
- STAGES
- STEPS
2021-10-08 11:20:05 +02:00
- name : additionalTags
type : "[]string"
2021-10-28 13:52:21 +02:00
description : List of tags which will be pushed to the registry (additionally to the provided `containerImageTag`), e.g. "latest".
2021-10-08 11:20:05 +02:00
scope :
- PARAMETERS
- STAGES
- STEPS
2021-11-03 13:37:26 +02:00
- name : bindings
type : "map[string]interface{}"
description : |
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).
Example : Custom maven settings.xml for the Java Buildpack
```yaml
bindings :
maven-settings :
type : maven
key : settings.xml
file : path/to/settings.xml
```
2021-12-23 11:21:13 +02:00
inline :
2021-11-03 13:37:26 +02:00
```yaml
bindings :
maven-settings :
type : maven
key : settings.xml
content : "inline settings.xml"
```
2021-12-23 11:21:13 +02:00
from url :
```yaml
bindings :
maven-settings :
type : maven
key : settings.xml
fromUrl : https://url-to/setting.xml
```
2021-11-03 13:37:26 +02:00
scope :
- PARAMETERS
- STAGES
- STEPS
2022-02-15 15:39:14 +02:00
- name : multipleImages
aliases :
- name : images
type : "[]map[string]interface{}"
description : |
This parameter is only needed if `cnbBuild` should create multiple images.
Otherwise it can be ignored!!!
In case of multiple images, this array contains one entry for each image. That
entry can override any parameter from the main section, e.g.
```yaml
containerImageTag : latest
containerRegistryUrl : docker.io/example
dockerConfigJsonCredentialsId : CREDENTIALS
multipleImages :
- containerImageName : java-app
buildpacks :
- "java"
path : "source/java"
- containerImageName : nodejs-app
containerImageTag : v1.0.0
buildpacks :
- "nodejs"
path : "source/nodejs"
```
scope :
- PARAMETERS
- STAGES
- STEPS
2022-02-23 19:54:59 +02:00
- name : preserveFiles
type : "[]string"
description : |
List of globs, for keeping build results in the Jenkins workspace.
*Note*: globs will be calculated relative to the [path](#path) property.
scope :
- PARAMETERS
- STAGES
- STEPS
2021-08-18 12:10:55 +02:00
outputs :
resources :
- name : commonPipelineEnvironment
type : piperEnvironment
params :
- name : container/registryUrl
- name : container/imageNameTag
2022-02-15 15:39:14 +02:00
- name : container/imageNames
type : "[]string"
- name : container/imageNameTags
type : "[]string"
2021-08-18 12:10:55 +02:00
containers :
- image : "paketobuildpacks/builder:full"