Skip to content

Commit

Permalink
fix(INFRA-3587): final fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vineetguptadev committed Mar 8, 2024
1 parent 3eb6a2a commit 80a6776
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/packer/ubuntu-jammy-x86_64-public-ami.json.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ packer {
}

variable "skip_create_ami" {
type = bool
type = string
}

variable "tag" {
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-public-ami.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ jobs:
run: |
if [[ ${{ github.event_name }} == 'push' ]];
then
echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
echo "PKR_VAR_tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
else
echo "TAG=${{ inputs.tag }}" >> $GITHUB_ENV
echo "PKR_VAR_tag=${{ inputs.tag }}" >> $GITHUB_ENV
fi
shell: bash

- name: Set whether to skip ami creation in packer
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "Setting SKIP_CREATE_AMI to false"
echo "SKIP_CREATE_AMI=false" >> $GITHUB_ENV
echo "Setting PKR_VAR_skip_create_ami to False"
echo "PKR_VAR_skip_create_ami=False" >> $GITHUB_ENV
fi
- name: Configure AWS credentials
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/update-ami.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
# Environment Globals
product_id = os.getenv('PRODUCT_ID')
role_arn = os.getenv('ROLE_ARN')
vtag = os.getenv('TAG')
PKR_VAR_tag = vtag.replace('v', '')
PKR_VAR_skip_create_ami = os.getenv('SKIP_CREATE_AMI', "true")
vtag = os.getenv('PKR_VAR_tag')
tag = vtag.replace('v', '')
skip_create_ami = os.getenv('PKR_VAR_skip_create_ami', "True")

def packer_build(packerfile):
print("Running the packer build")
Expand Down

0 comments on commit 80a6776

Please sign in to comment.