stages: - build - deploy build: stage: build script: - docker build --build-arg=COMMIT=$(git rev-parse --short HEAD) . -t "cmc:latest" deploy_production: stage: deploy script: - cd /home/cmc/cmc-sales - git pull origin master - cp /home/cmc/cmc-sales/userpasswd /home/cmc/userpasswd - echo "Run the new docker image" - /home/cmc/cmc-sales/run_docker_prd.sh environment: name: production only: - master