image: docker:stable stages: - build - deploy variables: IMAGE_NAME: registry.hottis.de/wolutator/homepage build: stage: build tags: - hottis - linux - docker script: - VERSION=`cat VERSION` - echo "Version is $VERSION" - docker build --tag ${IMAGE_NAME}:latest --tag ${IMAGE_NAME}:$VERSION . - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker push ${IMAGE_NAME}:latest - docker push ${IMAGE_NAME}:$VERSION deploy: stage: deploy tags: - hottis - linux - docker script: - VERSION=`cat VERSION` - echo "Version is $VERSION" - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY - docker stop homepage || echo "homepage not running, anyway okay" - docker pull ${IMAGE_NAME}:$VERSION - docker run -d --rm --name homepage --network ${PROD_NETWORK} --ip ${PROD_ADDRESS} ${IMAGE_NAME}:$VERSION environment: name: production url: https://home.hottis.de/wolutator/