GitLab CI: Build an image tagged latest-stable for master.

This commit is contained in:
s3lph 2018-08-02 21:55:22 +02:00
parent 1dd1640cbe
commit f8871a73e2

View file

@ -24,12 +24,13 @@ build:
stage: build stage: build
script: script:
- docker build -t "registry.gitlab.com/s3lph/matemat:$(git rev-parse HEAD)" . - docker build -t "registry.gitlab.com/s3lph/matemat:$(git rev-parse HEAD)" .
- docker tag "registry.gitlab.com/s3lph/matemat:$(git rev-parse HEAD)" registry.gitlab.com/s3lph/matemat:latest-staging - docker tag "registry.gitlab.com/s3lph/matemat:$(git rev-parse HEAD)" "registry.gitlab.com/s3lph/matemat:latest-$([[ $(git symbolic-ref --short HEAD) == "master" ]] && echo stable || staging)"
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_TOKEN registry.gitlab.com - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_TOKEN registry.gitlab.com
- docker push "registry.gitlab.com/s3lph/matemat:$(git rev-parse HEAD)" - docker push "registry.gitlab.com/s3lph/matemat:$(git rev-parse HEAD)"
- docker push registry.gitlab.com/s3lph/matemat:latest-staging - docker push registry.gitlab.com/s3lph/matemat:latest-$([[ $(git symbolic-ref --short HEAD) == "master" ]] && echo stable || staging)
only: only:
- staging - staging
- master
staging: staging:
stage: staging stage: staging