Skip to content

Commit cf4b740

Browse files
committed
fix bash error
1 parent 06e2a5b commit cf4b740

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

.github/scripts/gcp-packer-build.sh

100644100755
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ sed -i "s#TEMPLATE_COSMIAN_AI_RUNNER_VERSION#$AI_RUNNER_VERSION#g" "$PACKER_FILE
3636

3737
cat "$PACKER_FILE"
3838

39-
plugins= ("git@github.com:hashicorp/packer-plugin-ansible.git" "git@github.com:hashicorp/packer-plugin-googlecompute.git")
39+
plugins='"https://github.com/hashicorp/packer-plugin-ansible.git" "https://github.com/hashicorp/packer-plugin-googlecompute.git"'
4040

4141
for plugin in $plugins; do
4242
git clone $plugin

packer/gcp.pkr.hcl

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
1-
source "googlecompute" "TEMPLATE_GOOGLE_COMPUTE" {
1+
variable "gcp_credentials_file" {
2+
type = string
3+
description = "packer.json"
4+
default = "packer.json"
5+
}
6+
7+
source "googlecompute" "redhat" {
8+
credentials_json = file(var.gcp_credentials_file)
29
ssh_username = "root"
310
ssh_timeout = "5m"
411
ssh_clear_authorized_keys = true
512
project_id = "cosmian-dev"
6-
source_image = "TEMPLATE_SOURCE_IMAGE"
7-
source_image_family = "TEMPLATE_SOURCE_FAMILY"
13+
source_image = "rhel-9-v20250709"
14+
source_image_family = "rhel-9"
815
zone = "europe-west4-a"
9-
image_name = "TEMPLATE_IMAGE_NAME"
10-
image_guest_os_features = ["TEMPLATE_OS_FEATURES"]
16+
image_name = "base-image-0-0-0-rhel-sev"
17+
image_guest_os_features = ["SEV_SNP_CAPABLE"]
1118
network = "default"
1219
subnetwork = "default"
1320
tags = ["ssh"]
@@ -16,12 +23,11 @@ source "googlecompute" "TEMPLATE_GOOGLE_COMPUTE" {
1623
}
1724

1825
build {
19-
sources = ["sources.googlecompute.TEMPLATE_GOOGLE_COMPUTE"]
20-
26+
sources = ["sources.googlecompute.redhat"]
2127
provisioner "ansible" {
22-
playbook_file = "../ansible/TEMPLATE_PRODUCT-packer-playbook.yml"
28+
playbook_file = "../ansible/base-image-packer-playbook.yml"
2329
local_port = 22
2430
use_proxy = false
25-
extra_arguments = ["-e", "cosmian_vm_version=TEMPLATE_COSMIAN_VM_VERSION", "-e", "cosmian_kms_version=TEMPLATE_COSMIAN_KMS_VERSION", "-e", "cosmian_ai_runner_version=TEMPLATE_COSMIAN_AI_RUNNER_VERSION"]
31+
extra_arguments = ["-e", "cosmian_vm_version=last_build/update_packer_plugins", "-e", "cosmian_kms_version=", "-e", "cosmian_ai_runner_version="]
2632
}
2733
}

0 commit comments

Comments
 (0)