mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 11:55:39 +00:00
CI: Change the push policy of the docker images
If we are in a fork of the project, we would like to be able to overwrite the `:latest` tag if the registry from any branch so we won't have to manually overwrite the image tag in the build/test jobs in the .gitlab-ci.yml file
This commit is contained in:
parent
345afee677
commit
8fbce56d69
1 changed files with 10 additions and 2 deletions
|
@ -40,9 +40,17 @@ test manifest:
|
|||
- docker build --pull -f ${DOCKERFILE} -t ${REF} ${CONTEXT_DIR}
|
||||
- docker image tag ${REF} ${LATEST}
|
||||
|
||||
# Push the images
|
||||
# If we are in a fork, push the image to the reigstry regardless the branch
|
||||
- |
|
||||
if [ "$CI_COMMIT_REF_NAME" = "master" ]; then
|
||||
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" && "$CI_PROJECT_NAMESPACE" = "gstreamer" ]; then
|
||||
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
||||
docker push ${REF}
|
||||
docker push ${LATEST}
|
||||
|
|
Loading…
Reference in a new issue