mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
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.
This commit is contained in:
parent
ed9ae8bb2b
commit
3cc8d5efb5
1 changed files with 4 additions and 3 deletions
|
@ -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}
|
||||
|
|
Loading…
Reference in a new issue