From a65bdd46fb7077f9b8b634e345353af8f8f9cd19 Mon Sep 17 00:00:00 2001 From: Derek Rada Date: Tue, 12 Mar 2024 12:08:36 -0700 Subject: [PATCH] upper case --- .github/packer/ubuntu-jammy-x86_64-public-ami.pkr.hcl | 4 ++-- .github/workflows/update-ami.py | 10 +--------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/packer/ubuntu-jammy-x86_64-public-ami.pkr.hcl b/.github/packer/ubuntu-jammy-x86_64-public-ami.pkr.hcl index 2e0f1f68a2b9..c319e87134c7 100644 --- a/.github/packer/ubuntu-jammy-x86_64-public-ami.pkr.hcl +++ b/.github/packer/ubuntu-jammy-x86_64-public-ami.pkr.hcl @@ -41,7 +41,7 @@ data "amazon-ami" "autogenerated_1" { locals { skip_create_ami = var.skip_create_ami == "True" timestamp = regex_replace(timestamp(), "[- TZ:]", "") - clean_name = regex_replace(lower(timestamp()), "[^a-z0-9-]", "-") + clean_name = regex_replace(timestamp(), "[^a-zA-Z0-9-]", "-") } source "amazon-ebs" "autogenerated_1" { @@ -49,7 +49,7 @@ source "amazon-ebs" "autogenerated_1" { ami_name = "public-avalanche-ubuntu-${var.version}-${var.tag}-${local.timestamp}" instance_type = "c5.large" region = "us-east-1" - skip_create_ami = "${local.skip_create_ami}" + skip_create_ami = local.skip_create_ami source_ami = "${data.amazon-ami.autogenerated_1.id}" ssh_username = "ubuntu" tags = { diff --git a/.github/workflows/update-ami.py b/.github/workflows/update-ami.py index 7fb416db4e4d..8cb55e2cf1e7 100755 --- a/.github/workflows/update-ami.py +++ b/.github/workflows/update-ami.py @@ -20,15 +20,7 @@ def packer_build(packerfile): print("Running the packer build") subprocess.run('/usr/local/bin/packer init ' + packerfile, shell=True) - output = subprocess.run('/usr/local/bin/packer build ' + packerfile, shell=True, stdout=subprocess.PIPE) - print(output.stdout) - found = re.findall('ami-[a-z0-9]*', str(output.stdout)) - - if found: - amiid = found[-1] - print("Found amiId=" + amiid) - else: - print("Did not find amiId") + subprocess.run('/usr/local/bin/packer build ' + packerfile, shell=True) def packer_build_update(packerfile): print("Creating packer AMI image for Marketplace")