mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-02-19 19:44:27 +02:00
* Add option to tag artifact version to containerPushToRegistryStep * Update vars/containerPushToRegistry.groovy Co-authored-by: breuerjo <36748317+breuerjo@users.noreply.github.com> * commonPipelineEnvironment instead of globalPipelineEnvironment Co-authored-by: breuerjo <36748317+breuerjo@users.noreply.github.com> Co-authored-by: Oliver Nocon <33484802+OliverNocon@users.noreply.github.com>
1.5 KiB
1.5 KiB
${docGenStepName}
${docGenDescription}
Prerequisites
You need to have a valid user with write permissions in the target docker registry.
Credentials for the target docker registry have been configured in Jenkins with a dedicated Id.
You can create the credentials in your Jenkins
via Jenkins -> Credentials -> System -> Global credentials (unrestricted) -> Add Credentials ->
- Kind: Username with Password
- ID: specify id which you then use for the configuration of
dockerCredentialsId
(see below)
Example
Usage of pipeline step:
OPTION A: To pull a Docker image from an existing docker registry and push to a different docker registry:
containerPushToRegistry script: this,
dockerCredentialsId: 'myTargetRegistryCredentials',
sourceRegistryUrl: 'https://mysourceRegistry.url',
sourceImage: 'path/to/mySourceImageWith:tag',
dockerRegistryUrl: 'https://my.target.docker.registry:50000'
OPTION B: To push a locally built docker image into the target registry (only possible when a Docker daemon is available on your Jenkins node):
containerPushToRegistry script: this,
dockerCredentialsId: 'myTargetRegistryCredentials',
dockerImage: 'path/to/myImageWith:tag',
dockerRegistryUrl: 'https://my.target.docker.registry:50000'