This is a plugin which provides docker images in GCR as package material in GoCD. It is inspired by this Docker image poller by Magnus Lyckå
To build the code base just execute:
mvn clean package
- GoCD Server 19.0+
Build the plugin as mentioned above.
Install one of our releases into ${GO_SERVER_DIR}/plugins/external
and restart the server.
To configure the package repository, you will only need to provide the following 3 items:
GCP Service Account Key
: Service account secret in JSON that has access to the desired GCR repository.GCP project id
: Google cloud project idGCR url
: GCR repository url, e.g. gcr.io, asia.gcr.io, us.gcr.io
To configure the material pulling packages from this repository, you will need to provide:
Package Name
: Name of package (on GoCD)Docker Image Name
: Name of the docker image in the repositoryDocker Tag Filter Regular Expression
: Filter for desired image tags in REGEX
When this material triggers the pipeline, it will set the following environment variables, which you can use in your pipeline to access the latest docker image.
GO_REPO_<docker registry name>_<package name>_DOCKER_REGISTRY_NAME
: docker imame registry nameGO_PACKAGE_<docker registry name>_<package name>_DOCKER_IMAGE
: docker image nameGO_PACKAGE_<docker registry name>_<package name>_LABEL
: docker image tag