Skip to content

Commit

Permalink
Setup ECS config directory if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
danehlim committed Mar 27, 2024
1 parent 1be5640 commit 8cd4db1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions al1.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ build {
destination = "/tmp/additional-packages"
}

provisioner "shell" {
script = "scripts/setup-ecs-config-dir.sh"
}

provisioner "shell" {
inline_shebang = "/bin/sh -ex"
inline = [
Expand Down
4 changes: 4 additions & 0 deletions al2.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ build {
]
}

provisioner "shell" {
script = "scripts/setup-ecs-config-dir.sh"
}

provisioner "shell" {
script = "scripts/install-docker.sh"
environment_vars = [
Expand Down
4 changes: 4 additions & 0 deletions al2023.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ build {
]
}

provisioner "shell" {
script = "scripts/setup-ecs-config-dir.sh"
}

provisioner "shell" {
script = "scripts/install-docker.sh"
environment_vars = [
Expand Down
12 changes: 12 additions & 0 deletions scripts/setup-ecs-config-dir.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -ex

sudo mkdir -p "/etc/ecs"

if [ ! -f "/etc/ecs/ecs.config" ]; then
sudo touch /etc/ecs/ecs.config
fi

if [ ! -f "/etc/ecs/ecs.config.json" ]; then
sudo touch /etc/ecs/ecs.config.json
fi

0 comments on commit 8cd4db1

Please sign in to comment.