From: Jordan Petridis Date: Sat, 24 Nov 2018 22:48:50 +0000 (+0200) Subject: Docker registry: only tag images for the upstream repository X-Git-Tag: 1.19.3~497^2~496 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3cc8d5efb54a13f19ad6c8129c3a48d7ceace26a;p=platform%2Fupstream%2Fgstreamer.git Docker registry: only tag images for the upstream repository The tags are only used to version the images that are meant to be used in the gitlab/ci_template.yml file. Thus tags are not needed when you hack on a patch from a forked repository. Lets just keep a :latest tag. --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52c371c..f076999 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -41,20 +41,21 @@ test manifest: - export REF="${IMAGE}:${CI_COMMIT_SHA}" - export LATEST="${IMAGE}:latest" - - docker build --pull -f ${DOCKERFILE} -t ${REF} ${CONTEXT_DIR} - - docker image tag ${REF} ${LATEST} + - docker build --pull -f ${DOCKERFILE} -t ${LATEST} ${CONTEXT_DIR} # If we are in a fork, push the image to the reigstry regardless the branch - | if [ "$CI_PROJECT_NAMESPACE" != "gstreamer" ]; then docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker push ${REF} docker push ${LATEST} fi # Push the images to the upstream registry - | if [ "$CI_COMMIT_REF_NAME" = "master" -a "$CI_PROJECT_NAMESPACE" = "gstreamer" ]; then + # Tag the image with the git ref + docker image tag ${LATEST} ${REF} + # Push the tags docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY docker push ${REF} docker push ${LATEST}