Skip to content

Commit 5e8c157

Browse files
committed
scripts: Move useful scripts into ebssurrogate/scripts, delete the rest
Most of these files aren't being used so no point having them in the tree. Its a little weird to have cleanup-qemu.sh in ebssurrogate subdir but there's already one file there so meh.
1 parent cf002f7 commit 5e8c157

19 files changed

Lines changed: 19 additions & 827 deletions

.github/workflows/qemu-image-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ on:
55
paths:
66
- .github/workflows/qemu-image-build.yml
77
- ansible/vars.yml
8+
- ebssurrogate/scripts/*
89
- nix/packages/build-qemu-image/*
910
- qemu.pkr.hcl
10-
- scripts/*
1111
workflow_dispatch:
1212

1313
permissions:

amazon-amd64-nix.pkr.hcl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ build {
211211
destination = "/tmp/chroot-bootstrap-nix.sh"
212212
}
213213

214+
provisioner "file" {
215+
source = "ebssurrogate/scripts/cleanup.sh"
216+
destination = "/tmp/cleanup.sh"
217+
}
218+
214219
provisioner "file" {
215220
source = "ebssurrogate/files/cloud.cfg"
216221
destination = "/tmp/cloud.cfg"
@@ -241,11 +246,6 @@ build {
241246
destination = "/tmp/ansible-playbook"
242247
}
243248

244-
provisioner "file" {
245-
source = "scripts"
246-
destination = "/tmp/ansible-playbook"
247-
}
248-
249249
provisioner "file" {
250250
source = "ansible/vars.yml"
251251
destination = "/tmp/ansible-playbook/vars.yml"

amazon-arm64-nix.pkr.hcl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ build {
211211
destination = "/tmp/chroot-bootstrap-nix.sh"
212212
}
213213

214+
provisioner "file" {
215+
source = "ebssurrogate/scripts/cleanup.sh"
216+
destination = "/tmp/cleanup.sh"
217+
}
218+
214219
provisioner "file" {
215220
source = "ebssurrogate/files/cloud.cfg"
216221
destination = "/tmp/cloud.cfg"
@@ -241,11 +246,6 @@ build {
241246
destination = "/tmp/ansible-playbook"
242247
}
243248

244-
provisioner "file" {
245-
source = "scripts"
246-
destination = "/tmp/ansible-playbook"
247-
}
248-
249249
provisioner "file" {
250250
source = "ansible/vars.yml"
251251
destination = "/tmp/ansible-playbook/vars.yml"

ebssurrogate/scripts/qemu-bootstrap-nix.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ function clean_legacy_things {
134134

135135
function clean_system {
136136
# Copy cleanup scripts
137-
chmod +x /tmp/ansible-playbook/scripts/90-cleanup-qemu.sh
138-
/tmp/ansible-playbook/scripts/90-cleanup-qemu.sh
137+
chmod +x /tmp/cleanup-qemu.sh
138+
/tmp/cleanup-qemu.sh
139139

140140
# # Cleanup logs
141141
rm -rf /var/log/*

ebssurrogate/scripts/surrogate-bootstrap-nix.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,9 @@ function update_systemd_services {
363363

364364
function clean_system {
365365
# Copy cleanup scripts
366-
cp -v /tmp/ansible-playbook/scripts/90-cleanup.sh /mnt/tmp
367-
chmod +x /mnt/tmp/90-cleanup.sh
368-
chroot /mnt /tmp/90-cleanup.sh
366+
cp -v /tmp/cleanup.sh /mnt/tmp
367+
chmod +x /mnt/tmp/cleanup.sh
368+
chroot /mnt /tmp/cleanup.sh
369369

370370
# Cleanup logs
371371
rm -rf /mnt/var/log/*

nix/packages/build-ami.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ let
1818
(root + "/ebssurrogate")
1919
(root + "/ansible")
2020
(root + "/migrations")
21-
(root + "/scripts")
2221
(root + "/amazon-amd64-nix.pkr.hcl")
2322
(root + "/amazon-arm64-nix.pkr.hcl")
2423
(root + "/development-amd64.vars.pkr.hcl")

qemu.pkr.hcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ build {
9797
}
9898

9999
provisioner "file" {
100-
source = "scripts"
101-
destination = "/tmp/ansible-playbook"
100+
source = "ebssurrogate/scripts/cleanup-qemu.sh"
101+
destination = "/tmp/cleanup-qemu.sh"
102102
}
103103

104104
provisioner "shell" {

0 commit comments

Comments
 (0)