This repository was archived by the owner on Mar 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-20
lines changed Expand file tree Collapse file tree 1 file changed +15
-20
lines changed Original file line number Diff line number Diff line change 1
1
# This template uses AWS CDK and AWS CLI to make infrastrcutre updates
2
2
# and to deploy changes to the frontend and backend
3
3
4
+ workflow :
5
+ rules :
6
+ - if : ' $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master"'
7
+ when : always
8
+
4
9
variables :
5
10
ENVIRONMENT : dev
6
11
@@ -60,39 +65,29 @@ cdk deploy:
60
65
Name=tag:StackName,Values=${ENVIRONMENT}-${APP_NAME} \
61
66
Name=tag:aws-cdk:subnet-type,Values=Public \
62
67
| jq -r '.Subnets | map(.SubnetId) | join(",")')
63
-
64
- collectstatic :
65
- << : *task
66
68
script :
67
69
- |
68
70
aws ecs run-task \
69
71
--cluster ${ENVIRONMENT}-${APP_NAME}-cluster \
70
- --task-definition ${ENVIRONMENT}-${APP_NAME}-collectstatic \
72
+ --task-definition ${ENVIRONMENT}-${APP_NAME}-${TASK_SUFFIX} \
71
73
--network-configuration "awsvpcConfiguration={subnets=[${subnets}],assignPublicIp=ENABLED}" \
72
74
--count 1 \
73
75
--launch-type FARGATE
74
76
77
+ collectstatic :
78
+ << : *task
79
+ variables :
80
+ TASK_SUFFIX : collectstatic
81
+
75
82
migrate :
76
83
<< : *task
77
- script :
78
- - |
79
- aws ecs run-task \
80
- --cluster ${ENVIRONMENT}-${APP_NAME}-cluster \
81
- --task-definition ${ENVIRONMENT}-${APP_NAME}-migrate \
82
- --network-configuration "awsvpcConfiguration={subnets=[${subnets}],assignPublicIp=ENABLED}" \
83
- --count 1 \
84
- --launch-type FARGATE
84
+ variables :
85
+ TASK_SUFFIX : migrate
85
86
86
87
createsuperuser :
87
88
<< : *task
88
- script :
89
- - |
90
- aws ecs run-task \
91
- --cluster ${ENVIRONMENT}-${APP_NAME}-cluster \
92
- --task-definition ${ENVIRONMENT}-${APP_NAME}-create-superuser \
93
- --network-configuration "awsvpcConfiguration={subnets=[${subnets}],assignPublicIp=ENABLED}" \
94
- --count 1 \
95
- --launch-type FARGATE
89
+ variables :
90
+ TASK_SUFFIX : create-superuser
96
91
97
92
cdk destroy :
98
93
image : python:3.8
You can’t perform that action at this time.
0 commit comments