Skip to content

Commit

Permalink
fix Required plugins are not installed during destroy of ami
Browse files Browse the repository at this point in the history
  • Loading branch information
bidoubiwa committed Jun 14, 2023
1 parent c400f4c commit a26449a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 0 additions & 2 deletions .github/scripts/check_meilisearch_availability.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ status="$(curl http://$PUBLIC_IP/health)"

# Check if the variable content is equal to '{"status":"available"}'
if [ "$status" != '{"status":"available"}' ]; then
# If not, echo the variable value and an error message, and exit with code 1
echo "Error: Meilisearch is not running correctly."
echo "Server response: $status"
exit 1
else
# If it is equal, echo a success message and exit with code 0
echo "Meilisearch is available."
exit 0
fi
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
image_id="$(packer build -var 'image_name=${{ github.run_id }}' -machine-readable -only "amazon-ebs.*" meilisearch.pkr.hcl | awk -F, '$0 ~/artifact,0,id/ {print $6}' | cut -d ":" -f 2)"
echo "IMAGE_ID=$image_id" >> $GITHUB_ENV
- name: check env
run: echo ${{ env.IMAGE_ID }}
- name: check env
- name: check env.IMAGE_ID
run: echo "${{ env.IMAGE_ID }}"
- name: check IMAGE_ID
run: echo $IMAGE_ID

- name: Install Terraform
Expand All @@ -59,6 +59,7 @@ jobs:
- name: Destroy instance and AMI
if: always()
run: |
terraform init
terraform destroy -var ami_id=$IMAGE_ID -auto-approve

0 comments on commit a26449a

Please sign in to comment.