gitlab-ci.yml: Allow tagging images built on upstream branches

If we're on the gstreamer namespace, we should push all images built
on that namespace to the registry. This is needed to, f.ex., update
the docker image used in stable builds. This is needed for:
https://gitlab.freedesktop.org/gstreamer/cerbero/merge_requests/367
This commit is contained in:
Nirbheek Chauhan 2020-01-07 12:58:21 +05:30
parent 6b09187d21
commit eedde1884a

View file

@ -47,9 +47,9 @@ test manifest:
# Push the images to the upstream registry # Push the images to the upstream registry
- | - |
if [ "$CI_COMMIT_REF_NAME" = "master" -a "$CI_PROJECT_NAMESPACE" = "gstreamer" ]; then if [ "$CI_PROJECT_NAMESPACE" = "gstreamer" ]; then
# Tag the image with the git ref # Tag the image with the git ref
docker image tag ${LATEST} ${_UID} docker image tag ${LATEST} ${_UID}-${CI_COMMIT_REF_NAME}
# Push the tags # Push the tags
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
docker push ${_UID} docker push ${_UID}