Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # This file is a template, and might need editing before it works on your project.
- # Official docker image.
- stages:
- - version
- - build
- - deploy
- variables:
- DOCKER_DRIVER: overlay
- version:
- stage: version
- image: mrooding/gitlab-semantic-versioning
- script:
- - python3 /version-update/version-update.py
- - VERSSI=$(git describe --tags --always)
- - echo "export VERSSI=$VERSSI" > .variables
- - cat .variables
- artifacts:
- paths:
- - .variables
- only:
- - master
- build-master:
- stage: build
- image: docker:18.09
- services:
- - docker:dind
- before_script:
- - docker login --username gitlab-ci-token --password $NPA_PASSWORD $Registry
- - source .variables
- script:
- - docker build -t $Tagging:latest .
- - docker tag $Tagging:latest $Tagging:$VERSSI
- - docker push $Tagging:latest
- - docker push $Tagging:$VERSSI
- after_script:
- - docker logout $Registry
- only:
- - master
- build-staging:
- stage: build
- image: docker:18.09
- services:
- - docker:dind
- before_script:
- - docker login --username gitlab-ci-token --password $NPA_PASSWORD $Registry
- script:
- - docker build -t $Tagging:staging .
- - docker push $Tagging:staging
- after_script:
- - docker logout $Registry
- only:
- - staging
- build-devel:
- stage: build
- image: docker:18.09
- services:
- - docker:dind
- before_script:
- - docker login --username gitlab-ci-token --password $NPA_PASSWORD $Registry
- script:
- - docker build -t $Tagging:devel .
- - docker push $Tagging:devel
- after_script:
- - docker logout $Registry
- only:
- - devel
- deploy-master:
- stage: deploy
- image: docker:18.09
- services:
- - docker:dind
- script:
- - $RunProd
- only:
- - master
- deploy-staging:
- stage: deploy
- image: docker:18.09
- services:
- - docker:dind
- script:
- - $RunStag
- only:
- - staging
- deploy-devel:
- stage: deploy
- image: docker:18.09
- services:
- - docker:dind
- script:
- - $RunDev
- only:
- - devel
Add Comment
Please, Sign In to add comment