Skip to content

Commit 17d35dd

Browse files
committed
test: temp test for ext handling
1 parent f5d9bff commit 17d35dd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/testinfra-ami-build.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,12 @@ jobs:
9696
9797
- name: Patch stage2-nix-psql.pkr.hcl to create pg_extensions.json
9898
run: |
99-
cat >> stage2-nix-psql.pkr.hcl << 'EOF'
99+
# Get the line number of the last closing brace
100+
LAST_BRACE_LINE=$(grep -n '}' stage2-nix-psql.pkr.hcl | tail -n 1 | cut -d: -f1)
101+
102+
# Create a temporary file with the new content
103+
head -n $((LAST_BRACE_LINE-1)) stage2-nix-psql.pkr.hcl > temp.pkr.hcl
104+
cat >> temp.pkr.hcl << 'EOF'
100105
# Add provisioner to create pg_extensions.json
101106
provisioner "shell" {
102107
inline = [
@@ -105,7 +110,12 @@ jobs:
105110
"echo 'Created pg_extensions.json with content:' && sudo cat /root/pg_extensions.json"
106111
]
107112
}
113+
}
108114
EOF
115+
116+
# Replace the original file
117+
mv temp.pkr.hcl stage2-nix-psql.pkr.hcl
118+
109119
# Display the modified file to verify
110120
echo "Modified stage2-nix-psql.pkr.hcl:"
111121
tail -n 10 stage2-nix-psql.pkr.hcl

0 commit comments

Comments
 (0)