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: ...@@ -23,7 +23,6 @@ stages:
- valgrind_functional - valgrind_functional
- multiple_tests - multiple_tests
- prepare_deploy - prepare_deploy
- deploy_docker
- deploy_prod - deploy_prod
# Anchors # Anchors
...@@ -338,13 +337,21 @@ deploy_review: ...@@ -338,13 +337,21 @@ deploy_review:
- web - web
deploy_docker: deploy_docker:
stage: deploy_docker stage: deploy_prod
script: script:
- docker tag $CI_BUILD_REF_SLUG vidjil/vidjil:latest - export CUR_DATE=date +%Y-%m-%d
- docker push vidjil/vidjil:latest - 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 when: manual
only: only:
- prod-server - prod-server
- prod-client
tags: tags:
- web - web
- docker - 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