2021-08-18 12:10:55 +02:00
# ${docGenStepName}
## ${docGenDescription}
2021-10-28 13:52:21 +02:00
see [Examples ](#examples )
## Prerequisites
When pushing to a container registry, you need to maintain the respective credentials in your Jenkins credentials store:
`cnbBuild` expects a Docker `config.json` file containing the credential information for registries.
You can create it like explained in the [protocodeExecuteScan Prerequisites section ](https://www.project-piper.io/steps/protecodeExecuteScan/#prerequisites ).
Please copy this file and upload it to your Jenkins for example< br / >
via _Jenkins_ -> _Credentials_ -> _System_ -> _Global credentials (unrestricted)_ -> _Add Credentials_ ->
* Kind: _Secret file_
* File: upload your `config.json` file
* ID: specify id which you then use for the configuration of `dockerConfigJsonCredentialsId` (see below)
## ${docGenParameters}
2021-09-14 15:38:58 +02:00
### Additional hints
To run the `cnbBuild` with a different builder, you can specify the `dockerImage` parameter.
Without specifying it, the step will run with the `paketobuildpacks/builder:full` builder.
2021-08-18 12:10:55 +02:00
## ${docGenConfiguration}
## ${docJenkinsPluginDependencies}
2021-09-14 15:38:58 +02:00
2021-10-28 13:52:21 +02:00
## Examples
### Example 1: simple usage
2021-09-14 15:38:58 +02:00
```groovy
cnbBuild(
script: script,
dockerConfigJsonCredentialsId: 'DOCKER_REGISTRY_CREDS',
containerImageName: 'images/example',
containerImageTag: 'v0.0.1',
containerImageRegistryUrl: 'gcr.io'
)
```
2021-10-28 13:52:21 +02:00
### Example 2: User provided builder
2021-09-14 15:38:58 +02:00
```groovy
cnbBuild(
script: script,
dockerConfigJsonCredentialsId: 'DOCKER_REGISTRY_CREDS',
dockerImage: 'paketobuildpacks/builder:base',
containerImageName: 'images/example',
containerImageTag: 'v0.0.1',
containerImageRegistryUrl: 'gcr.io'
)
```
2021-09-14 16:14:50 +02:00
2021-10-28 13:52:21 +02:00
### Example 3: User provided buildpacks
2021-09-14 16:14:50 +02:00
```groovy
cnbBuild(
script: script,
dockerConfigJsonCredentialsId: 'DOCKER_REGISTRY_CREDS',
containerImageName: 'images/example',
containerImageTag: 'v0.0.1',
containerImageRegistryUrl: 'gcr.io',
buildpacks: ['gcr.io/paketo-buildpacks/nodejs', 'paketo-community/build-plan']
)
```