Skip to content

Commit bbd669e

Browse files
authored
Merge pull request #121 from SWU-Elixir/chore/115-cicd
chore: ecs 배포 방식 변경에 따른 cicd pipeline 수정
2 parents 925dbe9 + 62164f1 commit bbd669e

File tree

2 files changed

+20
-68
lines changed

2 files changed

+20
-68
lines changed

.github/workflows/ecs-deploy.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ jobs:
1414
env:
1515
AWS_REGION: ap-northeast-2
1616
ECR_REPOSITORY: elixir
17-
ECS_SERVICE: elixir-task-df-service-7-1
18-
ECS_CLUSTER: elixir-cluster
17+
ECS_SERVICE: elixir-service
18+
ECS_CLUSTER: ElixirCluster
1919
ECS_TASK_DEFINITION: task-definition.json
2020
CONTAINER_NAME: elixir-container
2121

@@ -58,8 +58,6 @@ jobs:
5858
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
5959
echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT
6060
61-
# docker build --platform linux/amd64 -t ecr 레포지토리 위치/ecr 레포지토리명:latest -f Dockerfile.production .
62-
6361
- name: Fill in the new image ID in the Amazon ECS task definition
6462
id: task-def
6563
uses: aws-actions/amazon-ecs-render-task-definition@v1
@@ -68,10 +66,10 @@ jobs:
6866
container-name: ${{ env.CONTAINER_NAME }}
6967
image: ${{ steps.build-image.outputs.image }}
7068

71-
- name: Deploy Amazon ECS task definition without rolling update
69+
- name: Deploy Amazon ECS task definition
7270
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
7371
with:
7472
task-definition: ${{ steps.task-def.outputs.task-definition }}
7573
service: ${{ env.ECS_SERVICE }}
7674
cluster: ${{ env.ECS_CLUSTER }}
77-
wait-for-service-stability: false
75+
wait-for-service-stability: true

task-definition.json

Lines changed: 16 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
{
2+
"family": "elixir-task-df",
3+
"taskRoleArn": "arn:aws:iam::448270596607:role/ecs-task-role",
4+
"executionRoleArn": "arn:aws:iam::448270596607:role/ecs-task-execution-role",
5+
"networkMode": "awsvpc",
6+
"requiresCompatibilities": ["FARGATE"],
7+
"cpu": "1024",
8+
"memory": "3072",
9+
"runtimePlatform": {
10+
"cpuArchitecture": "X86_64",
11+
"operatingSystemFamily": "LINUX"
12+
},
213
"containerDefinitions": [
314
{
415
"name": "elixir-container",
@@ -20,8 +31,6 @@
2031
"value": "prod"
2132
}
2233
],
23-
"mountPoints": [],
24-
"volumesFrom": [],
2534
"secrets": [
2635
{
2736
"name": "AWS_ACCESSKEY",
@@ -81,10 +90,8 @@
8190
"max-buffer-size": "25m",
8291
"awslogs-region": "ap-northeast-2",
8392
"awslogs-stream-prefix": "ecs"
84-
},
85-
"secretOptions": []
86-
},
87-
"systemControls": []
93+
}
94+
}
8895
},
8996
{
9097
"name": "redis-container",
@@ -98,60 +105,7 @@
98105
"protocol": "tcp"
99106
}
100107
],
101-
"essential": true,
102-
"environment": [],
103-
"environmentFiles": [],
104-
"mountPoints": [],
105-
"volumesFrom": [],
106-
"systemControls": []
108+
"essential": true
107109
}
108-
],
109-
"family": "elixir-task-df",
110-
"taskRoleArn": "arn:aws:iam::448270596607:role/ecs-task-role",
111-
"executionRoleArn": "arn:aws:iam::448270596607:role/ecs-task-execution-role",
112-
"networkMode": "awsvpc",
113-
"volumes": [],
114-
"requiresAttributes": [
115-
{
116-
"name": "com.amazonaws.ecs.capability.logging-driver.awslogs"
117-
},
118-
{
119-
"name": "ecs.capability.execution-role-awslogs"
120-
},
121-
{
122-
"name": "com.amazonaws.ecs.capability.ecr-auth"
123-
},
124-
{
125-
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.19"
126-
},
127-
{
128-
"name": "ecs.capability.secrets.asm.environment-variables"
129-
},
130-
{
131-
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.28"
132-
},
133-
{
134-
"name": "com.amazonaws.ecs.capability.task-iam-role"
135-
},
136-
{
137-
"name": "ecs.capability.execution-role-ecr-pull"
138-
},
139-
{
140-
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.18"
141-
},
142-
{
143-
"name": "ecs.capability.task-eni"
144-
},
145-
{
146-
"name": "com.amazonaws.ecs.capability.docker-remote-api.1.29"
147-
}
148-
],
149-
"placementConstraints": [],
150-
"cpu": "512",
151-
"memory": "819",
152-
"runtimePlatform": {
153-
"cpuArchitecture": "X86_64",
154-
"operatingSystemFamily": "LINUX"
155-
},
156-
"tags": []
157-
}
110+
]
111+
}

0 commit comments

Comments
 (0)