Skip to content

Commit 262f7e9

Browse files
refactor ecs deploy action
1 parent 554fdeb commit 262f7e9

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

template/deploy/{% if 'aws-ecs-fargate' in deployment_targets %}ecs{% endif %}/.github-workflows-ecs.yml.jinja renamed to template/.github/workflows/{% if 'aws-ecs-fargate' in deployment_targets %}deploy-ecs.yml{% endif %}.jinja

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,9 @@ jobs:
163163
# Run migration task and capture task ARN
164164
TASK_ARN=$(aws ecs run-task \
165165
--cluster {{ project_slug }}-staging-cluster \
166-
--task-definition {{ project_slug }}-staging-app \
166+
--task-definition {{ project_slug }}-staging-migrate \
167167
--launch-type FARGATE \
168168
--network-configuration "awsvpcConfiguration={subnets=[{% raw %}${{ secrets.STAGING_SUBNET_IDS }}{% endraw %}],securityGroups=[{% raw %}${{ secrets.STAGING_SECURITY_GROUP_ID }}{% endraw %}],assignPublicIp=DISABLED}" \
169-
--overrides '{"containerOverrides":[{"name":"{{ project_slug }}","command":["python","manage.py","migrate","--noinput"]}]}' \
170169
--query 'tasks[0].taskArn' \
171170
--output text)
172171

@@ -273,10 +272,9 @@ jobs:
273272
# Run migration task and capture task ARN
274273
TASK_ARN=$(aws ecs run-task \
275274
--cluster {{ project_slug }}-production-cluster \
276-
--task-definition {% raw %}${{ steps.task-def.outputs.task-def }}{% endraw %} \
275+
--task-definition {{ project_slug }}-production-migrate \
277276
--launch-type FARGATE \
278277
--network-configuration "awsvpcConfiguration={subnets=[{% raw %}${{ secrets.PRODUCTION_SUBNET_IDS }}{% endraw %}],securityGroups=[{% raw %}${{ secrets.PRODUCTION_SECURITY_GROUP_ID }}{% endraw %}],assignPublicIp=DISABLED}" \
279-
--overrides '{"containerOverrides":[{"name":"{{ project_slug }}","command":["python","manage.py","migrate","--noinput"]}]}' \
280278
--query 'tasks[0].taskArn' \
281279
--output text)
282280

template/deploy/{% if 'aws-ecs-fargate' in deployment_targets %}ecs{% endif %}/README.md.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ ecs/
3939
│ ├── ecr.tf # Container registry
4040
│ ├── monitoring.tf # CloudWatch alarms and dashboard
4141
│ └── terraform.tfvars.example # Example variables file
42-
└── .github-workflows-ecs.yml # GitHub Actions CI/CD
42+
└── ../../.github/workflows/deploy-ecs.yml # GitHub Actions CI/CD
4343
```
4444

4545
## Prerequisites
@@ -478,7 +478,7 @@ aws logs tail /ecs/{{ project_slug }}-{environment} --follow --filter-pattern "c
478478

479479
### GitHub Actions
480480

481-
The included workflow (`.github-workflows-ecs.yml`) provides:
481+
The included workflow (`.github/workflows/deploy-ecs.yml`) provides:
482482

483483
**Features:**
484484
- Automated testing on pull requests

0 commit comments

Comments
 (0)