diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3eb6ea663af364b2d46ad8aaf103dd11d12d626d..02fc456ba91f8829694a2426c9d36d1ec9fe5c6b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,3 @@ -variables: - IMAGE_TAG: latest - REV_BUCKET: faraday-rollback - CI_PROJECT_NAME: faraday-qa - CI_CLUSTER_NAME: faraday-cluster - CI_SERVICE_NAME: faraday-container-service - IMAGE_TAG: $CI_PROJECT_NAME:$CI_COMMIT_SHA - IMAGE_NAME: "$REPOSITORY_URL/$IMAGE_TAG" - image: docker:stable stages: @@ -81,8 +72,8 @@ deploy:now: - now --public --docker --token $NOW_TOKEN -e AWS_S3_ACCESS_KEY=$AWS_S3_ACCESS_KEY -e AWS_S3_SECRET_KEY=$AWS_S3_SECRET_KEY -e AWS_S3_REGION=$AWS_S3_REGION -e AWS_S3_BUCKET=$AWS_S3_BUCKET -e AWS_SES_SECRET_KEY=$AWS_SES_SECRET_KEY -e AWS_SES_ACCESS_KEY=$AWS_SES_ACCESS_KEY -e AWS_SES_REGION=$AWS_SES_REGION -e EMAIL_SENDER=$EMAIL_SENDER -e secret=$SECRET -e DATABASE=$DATABASE -e DB_USER=$DB_USER -e DB_PASS=$DB_PASS -e DB_HOST=$DB_HOST - now alias $NOW_URL xpub-faraday-qa --token $NOW_TOKEN -test: - stage: test +deploy:create-rollback: + stage: deploy script: - export AWS_REGION="eu-west-1" - export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID @@ -91,7 +82,7 @@ test: - pip install awscli --upgrade --user - export PATH=~/.local/bin:/usr/bin/:$PATH # Discover the ALB name - - ALB=`aws elbv2 describe-load-balancers --region ${AWS_REGION} --names ${CI_PROJECT_NAME} | jq .LoadBalancers[0].DNSName` + - ALB=`aws elbv2 describe-load-balancers --region ${AWS_REGION} --names ${CI_ALB_NAME} | jq .LoadBalancers[0].DNSName` # Test Keepalive - /usr/bin/curl --fail http://${ALB//'"'}/keepalive # IF Keepalive return 200...