Commit 89e58b08 authored by Mathieu Giraud's avatar Mathieu Giraud

Merge branch 'docker_pre_deploy' into 'dev'

Docker pre deploy

See merge request !304
parents 74c7d926 65f87abc
Pipeline #43955 failed with stages
in 8 minutes and 56 seconds
......@@ -23,7 +23,6 @@ stages:
- valgrind_functional
- multiple_tests
- prepare_deploy
- deploy_docker
- deploy_prod
# Anchors
......@@ -338,13 +337,21 @@ deploy_review:
- web
deploy_docker:
stage: deploy_docker
stage: deploy_prod
script:
- docker tag $CI_BUILD_REF_SLUG vidjil/vidjil:latest
- docker push vidjil/vidjil:latest
- export CUR_DATE=date +%Y-%m-%d
- export TYPE=$CI_COMMIT_REF_NAME | awk '{ gsub(/prod-/, "") }{ print $1 }'
- export TAG="vidjil/$TYPE:$CI_COMMIT_SHA-$CUR_DATE"
- docker build --no-cache --build-arg git_branch=$CI_COMMIT_REF_NAME --build-arg build_env=PRODUCTION -t $TAG docker/vidjil-$TYPE
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
- docker push $TAG
- docker tag $TAG "vidjil/$TYPE:latest"
- docker push "vidjil/$TYPE:latest"
- docker rmi $TAG "vidjil/$TYPE:latest"
when: manual
only:
- prod-server
- prod-client
tags:
- web
- docker
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment