-
Notifications
You must be signed in to change notification settings - Fork 41
/
mithril.bootstrap.tf
48 lines (42 loc) · 1.3 KB
/
mithril.bootstrap.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
resource "null_resource" "mithril_bootstrap" {
connection {
type = "ssh"
user = "curry"
private_key = local.google_service_account_private_key
host = google_compute_address.mithril-external-address.address
}
triggers = {
vm_instance = google_compute_instance.vm_instance.id,
image_id = var.mithril_image_id,
cardano_image_id = var.cardano_image_id,
cardano_image_registry = var.cardano_image_registry,
mithril_aggregator_auth_username = var.mithril_aggregator_auth_username,
mithril_aggregator_auth_password = var.mithril_aggregator_auth_password,
}
provisioner "file" {
source = "assets/infra.version"
destination = "/home/curry/infra.version"
}
provisioner "file" {
source = "assets/docker"
destination = "/home/curry"
}
provisioner "file" {
source = "assets/tools"
destination = "/home/curry"
}
provisioner "remote-exec" {
inline = [
<<-EOT
# Wait for VM startup script to complete
while ! test -f "/startup-ready.txt"; do
sleep 2
echo "Waiting for startup script to complete..."
done
echo "Startup script complete!"
EOT
,
"find /home/curry/tools -name '*.sh' -type f | xargs chmod u+x"
]
}
}