2020-06-23 00:09:42 +05:30
|
|
|
# WARNING (post-GitLab 13.0):
|
|
|
|
#
|
|
|
|
# This CI template should NOT be included in your own CI configuration files:
|
|
|
|
# 'review_ecs' and 'production_ecs' are two temporary names given to the jobs below.
|
|
|
|
#
|
|
|
|
# Should this template be included in your CI configuration, the upcoming name changes could
|
|
|
|
# then result in potentially breaking your future pipelines.
|
|
|
|
#
|
|
|
|
# More about including CI templates: https://docs.gitlab.com/ee/ci/yaml/#includetemplate
|
2021-01-29 00:20:46 +05:30
|
|
|
.ecs_image:
|
2022-08-27 11:52:29 +05:30
|
|
|
image: '${CI_TEMPLATE_REGISTRY_HOST}/gitlab-org/cloud-deploy/aws-ecs:latest'
|
2021-01-29 00:20:46 +05:30
|
|
|
|
|
|
|
.deploy_to_ecs:
|
|
|
|
extends: .ecs_image
|
2021-01-03 14:25:43 +05:30
|
|
|
dependencies: []
|
2020-05-24 23:13:21 +05:30
|
|
|
script:
|
|
|
|
- ecs update-task-definition
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
.review_ecs_base:
|
2020-05-24 23:13:21 +05:30
|
|
|
stage: review
|
2020-07-28 23:09:34 +05:30
|
|
|
extends: .deploy_to_ecs
|
2022-08-13 15:12:31 +05:30
|
|
|
after_script:
|
|
|
|
- echo "http://$(ecs get-task-hostname)" > environment_url.txt
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- environment_url.txt
|
2020-07-28 23:09:34 +05:30
|
|
|
|
|
|
|
.production_ecs_base:
|
|
|
|
stage: production
|
|
|
|
extends: .deploy_to_ecs
|
|
|
|
environment:
|
|
|
|
name: production
|
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
.stop_review_ecs_base:
|
|
|
|
extends: .ecs_image
|
|
|
|
stage: cleanup
|
|
|
|
allow_failure: true
|
|
|
|
script:
|
|
|
|
- ecs stop-task
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
review_ecs:
|
|
|
|
extends: .review_ecs_base
|
2021-01-29 00:20:46 +05:30
|
|
|
environment:
|
|
|
|
name: review/$CI_COMMIT_REF_NAME
|
|
|
|
on_stop: stop_review_ecs
|
2020-05-24 23:13:21 +05:30
|
|
|
rules:
|
|
|
|
- if: '$AUTO_DEVOPS_PLATFORM_TARGET != "ECS"'
|
|
|
|
when: never
|
2021-12-11 22:18:48 +05:30
|
|
|
- if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
|
2020-05-24 23:13:21 +05:30
|
|
|
when: never
|
|
|
|
- if: '$REVIEW_DISABLED'
|
|
|
|
when: never
|
2021-04-17 20:07:23 +05:30
|
|
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
2020-06-23 00:09:42 +05:30
|
|
|
when: never
|
|
|
|
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
|
2020-05-24 23:13:21 +05:30
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
stop_review_ecs:
|
|
|
|
extends: .stop_review_ecs_base
|
|
|
|
environment:
|
|
|
|
name: review/$CI_COMMIT_REF_NAME
|
|
|
|
action: stop
|
|
|
|
rules:
|
|
|
|
- if: '$AUTO_DEVOPS_PLATFORM_TARGET != "ECS"'
|
|
|
|
when: never
|
2021-12-11 22:18:48 +05:30
|
|
|
- if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
|
2021-01-29 00:20:46 +05:30
|
|
|
when: never
|
|
|
|
- if: '$REVIEW_DISABLED'
|
|
|
|
when: never
|
2021-04-17 20:07:23 +05:30
|
|
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
2021-01-29 00:20:46 +05:30
|
|
|
when: never
|
|
|
|
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
|
|
|
|
when: manual
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
review_fargate:
|
|
|
|
extends: .review_ecs_base
|
2021-01-29 00:20:46 +05:30
|
|
|
environment:
|
|
|
|
name: review/$CI_COMMIT_REF_NAME
|
|
|
|
on_stop: stop_review_fargate
|
|
|
|
script:
|
|
|
|
- ecs update-task-definition
|
|
|
|
rules:
|
|
|
|
- if: '$AUTO_DEVOPS_PLATFORM_TARGET != "FARGATE"'
|
|
|
|
when: never
|
2021-12-11 22:18:48 +05:30
|
|
|
- if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
|
2021-01-29 00:20:46 +05:30
|
|
|
when: never
|
|
|
|
- if: '$REVIEW_DISABLED'
|
|
|
|
when: never
|
2021-04-17 20:07:23 +05:30
|
|
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
2021-01-29 00:20:46 +05:30
|
|
|
when: never
|
|
|
|
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
|
|
|
|
|
|
|
|
stop_review_fargate:
|
|
|
|
extends: .stop_review_ecs_base
|
|
|
|
environment:
|
|
|
|
name: review/$CI_COMMIT_REF_NAME
|
|
|
|
action: stop
|
2020-07-28 23:09:34 +05:30
|
|
|
rules:
|
|
|
|
- if: '$AUTO_DEVOPS_PLATFORM_TARGET != "FARGATE"'
|
|
|
|
when: never
|
2021-12-11 22:18:48 +05:30
|
|
|
- if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
|
2020-07-28 23:09:34 +05:30
|
|
|
when: never
|
|
|
|
- if: '$REVIEW_DISABLED'
|
|
|
|
when: never
|
2021-04-17 20:07:23 +05:30
|
|
|
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
2020-07-28 23:09:34 +05:30
|
|
|
when: never
|
|
|
|
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
|
2021-01-29 00:20:46 +05:30
|
|
|
when: manual
|
2020-07-28 23:09:34 +05:30
|
|
|
|
2020-05-24 23:13:21 +05:30
|
|
|
production_ecs:
|
2020-07-28 23:09:34 +05:30
|
|
|
extends: .production_ecs_base
|
2020-05-24 23:13:21 +05:30
|
|
|
rules:
|
|
|
|
- if: '$AUTO_DEVOPS_PLATFORM_TARGET != "ECS"'
|
|
|
|
when: never
|
2021-12-11 22:18:48 +05:30
|
|
|
- if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
|
2020-05-24 23:13:21 +05:30
|
|
|
when: never
|
2021-04-17 20:07:23 +05:30
|
|
|
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
|
2020-06-23 00:09:42 +05:30
|
|
|
when: never
|
|
|
|
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
|
2020-07-28 23:09:34 +05:30
|
|
|
|
|
|
|
production_fargate:
|
|
|
|
extends: .production_ecs_base
|
|
|
|
rules:
|
|
|
|
- if: '$AUTO_DEVOPS_PLATFORM_TARGET != "FARGATE"'
|
|
|
|
when: never
|
2021-12-11 22:18:48 +05:30
|
|
|
- if: '$CI_KUBERNETES_ACTIVE || $KUBECONFIG'
|
2020-07-28 23:09:34 +05:30
|
|
|
when: never
|
2021-04-17 20:07:23 +05:30
|
|
|
- if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
|
2020-07-28 23:09:34 +05:30
|
|
|
when: never
|
|
|
|
- if: '$CI_COMMIT_TAG || $CI_COMMIT_BRANCH'
|