Skip to content

Commit f079f12

Browse files
authored
test: multiple container names (#407)
1 parent 0f5a72f commit f079f12

4 files changed

Lines changed: 43 additions & 1 deletion

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
coverage
2+
node_modules

expected-task-definition.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@
2020
"image": "amazon/amazon-ecs-sample:latest",
2121
"essential": true,
2222
"name": "sample-app"
23+
},
24+
{
25+
"entryPoint": [
26+
"sh",
27+
"-c"
28+
],
29+
"portMappings": [
30+
{
31+
"protocol": "tcp",
32+
"containerPort": 80
33+
}
34+
],
35+
"command": [
36+
"/bin/sh -c \"echo '<html> <head> <title>Amazon ECS Sample App</title> <style>body {margin-top: 40px; background-color: #333;} </style> </head><body> <div style=color:white;text-align:center> <h1>Amazon ECS Sample App</h1> <h2>Congratulations!</h2> <p>Your application is now running on a container in Amazon ECS.</p> </div></body></html>' > /usr/local/apache2/htdocs/index.html && httpd-foreground\""
37+
],
38+
"cpu": 256,
39+
"memoryReservation": 512,
40+
"image": "amazon/amazon-ecs-sample:latest",
41+
"essential": true,
42+
"name": "sample-app-2"
2343
}
2444
],
2545
"memory": "512",

task-definition.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@
2020
"image": "httpd:2.4",
2121
"essential": true,
2222
"name": "sample-app"
23+
},
24+
{
25+
"entryPoint": [
26+
"sh",
27+
"-c"
28+
],
29+
"portMappings": [
30+
{
31+
"protocol": "tcp",
32+
"containerPort": 80
33+
}
34+
],
35+
"command": [
36+
"/bin/sh -c \"echo '<html> <head> <title>Amazon ECS Sample App</title> <style>body {margin-top: 40px; background-color: #333;} </style> </head><body> <div style=color:white;text-align:center> <h1>Amazon ECS Sample App</h1> <h2>Congratulations!</h2> <p>Your application is now running on a container in Amazon ECS.</p> </div></body></html>' > /usr/local/apache2/htdocs/index.html && httpd-foreground\""
37+
],
38+
"cpu": 256,
39+
"memoryReservation": 512,
40+
"image": "httpd:2.4",
41+
"essential": true,
42+
"name": "sample-app-2"
2343
}
2444
],
2545
"memory": "512",

test-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
uses: aws-actions/amazon-ecs-render-task-definition@v1
3535
with:
3636
task-definition: task-definition.json
37-
container-name: sample-app
37+
container-name: sample-app,sample-app-2
3838
image: amazon/amazon-ecs-sample:latest
3939

4040
- name: Validate Amazon ECS task definition file

0 commit comments

Comments
 (0)