indigo-dc / jenkins-pipeline-library

Jenkins pipeline library with common functionalities for CI/CD environments, mainly targeted for the implementation of the SQA baseline requirements from https://indigo-dc.github.io/sqa-baseline/
Apache License 2.0
11 stars 6 forks source link

Add docker-compose push support using predefined environment variables #92

Closed samuelbernardolip closed 4 years ago

samuelbernardolip commented 4 years ago

This is required for Worsica thematic service, so is possible to push the docker images into the defined registry. Push will run if environment variable JPL_DOCKERPUSH is defined. It should have the list of services separated by spaces to push the referenced images. If the value is ALL it will push all local built images defined in docker-compose.yml. There is also a special environment variable JPL_IGNOREFAILURES that if it is defined with some string without spaces, docker-compose push will ignore push failures. To force the related images build define JPL_DOCKERFORCEBUILD with some string. This will forcedly rebuild all images with build clause in docker-compose.yml. In case of using a docker registry server different from dockerhub, it can be set using the environment variable JPL_DOCKERSERVER. Docker Registry credentials must be defined using the following environment variables:

Image definitions will be placed in docker-compose.yml. Relevant details to add to JPL documentation in the following page: https://docs.docker.com/compose/compose-file/#image

Note: the official solution that will be provided through config.yml is buildpack with the reasons explained in the following issue https://github.com/indigo-dc/jenkins-pipeline-library/issues/40 This is only an alternative approach for those who don't want to use buildpack.

samuelbernardolip commented 4 years ago

This is already tested in current Worsica pipeline https://jenkins.eosc-synergy.eu/job/WORSICA/job/worsica-cicd/job/development/workflow-stage/