Skip to content

Commit

Permalink
Update packer
Browse files Browse the repository at this point in the history
  • Loading branch information
lucacome committed Jan 10, 2025
1 parent 3dc4d27 commit bff5b82
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@

# MacOS Finder
.DS_Store

license.jwt
29 changes: 17 additions & 12 deletions tools/build.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ packer {
required_plugins {
googlecompute = {
source = "github.com/hashicorp/googlecompute"
version = "1.1.6"
version = "1.1.3"
}
}
}
Expand Down Expand Up @@ -33,36 +33,41 @@ build {

provisioner "shell" {
inline = [
"curl -L https://nixos.org/nix/install -o install-nix.sh",
"chmod +x install-nix.sh",
"bash install-nix.sh --daemon",
"rm install-nix.sh",
"sed -i '1i. /etc/bashrc' ~/.bashrc"
"curl -L https://nixos.org/nix/install -o install-nix.sh",
"chmod +x install-nix.sh",
"bash install-nix.sh --daemon",
"rm install-nix.sh",
"sed -i '1i. /etc/bashrc' ~/.bashrc"
]
}

provisioner "file" {
source = "packages.nix"
destination = "/tmp/packages.nix"
}


provisioner "file" {
source = "license.jwt"
destination = "/tmp/license.jwt"
}

provisioner "shell" {
inline = [
"nix-env -if /tmp/packages.nix",
"sudo apt-get update",
"sudo apt-get install -y --no-install-recommends --no-install-suggests google-cloud-sdk-gke-gcloud-auth-plugin locales",
"echo 'en_US.UTF-8 UTF-8' | sudo tee /etc/locale.gen",
"sudo locale-gen",
"nix-env -if /tmp/packages.nix",
"sudo apt-get update",
"sudo apt-get install -y --no-install-recommends --no-install-suggests google-cloud-sdk-gke-gcloud-auth-plugin locales cloud-init",
"echo 'en_US.UTF-8 UTF-8' | sudo tee /etc/locale.gen",
"sudo locale-gen",
]
}

provisioner "shell" {
inline = [
"echo 'alias k='kubectl'' >> .bashrc",
"git clone https://github.com/nginxinc/nginx-gateway-fabric.git",
"cd nginx-gateway-fabric/tests",
"go mod download",
"cp /tmp/license.jwt ../license.jwt",
]
}

Expand Down

0 comments on commit bff5b82

Please sign in to comment.