diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1ccac32ac71466dfa9b288785d1d7d8562903ebb..cf3e10c8189c0fbf51b899c293c76e6bb6217dc2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -49,6 +49,8 @@ test: create-rollback: stage: test + only: + - master script: - export AWS_REGION="eu-west-1" - export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID @@ -73,6 +75,8 @@ create-rollback: aws-qa: stage: deploy + only: + - master script: - export AWS_REGION="eu-west-1" - export AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID @@ -101,6 +105,9 @@ now.sh: rollback: stage: rollback + when: on_failure + only: + - master script: - export AWS_REGION="us-east-1" - export AWS_ACCESS_KEY_ID=$aws_access_key_id @@ -115,5 +122,4 @@ rollback: - ecs deploy --region ${AWS_REGION} ${CLUSTER_NAME} ${CI_SERVICE_NAME} --task ${REV} -e ${CI_CONTAINER_NAME} AWS_S3_ACCESS_KEY $AWS_S3_ACCESS_KEY -e ${CI_CONTAINER_NAME} AWS_S3_SECRET_KEY $AWS_S3_SECRET_KEY -e ${CI_CONTAINER_NAME} AWS_S3_REGION $AWS_S3_REGION -e ${CI_CONTAINER_NAME} AWS_S3_BUCKET $AWS_S3_BUCKET -e ${CI_CONTAINER_NAME} AWS_SES_SECRET_KEY $AWS_SES_SECRET_KEY -e ${CI_CONTAINER_NAME} AWS_SES_ACCESS_KEY $AWS_SES_ACCESS_KEY -e ${CI_CONTAINER_NAME} AWS_SES_REGION $AWS_SES_REGION -e ${CI_CONTAINER_NAME} EMAIL_SENDER $EMAIL_SENDER -e ${CI_CONTAINER_NAME} secret $SECRET -e ${CI_CONTAINER_NAME} DATABASE $DATABASE -e ${CI_CONTAINER_NAME} DB_USER $DB_USER -e ${CI_CONTAINER_NAME} DB_PASS $DB_PASS -e ${CI_CONTAINER_NAME} DB_HOST $DB_HOST environment: name: qa - url: $CI_ALB_URL - when: on_failure \ No newline at end of file + url: $CI_ALB_URL \ No newline at end of file