Skip to content

Commit

Permalink
Add delete function for ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ifurther committed Jan 14, 2024
1 parent 710dc5b commit f1c6976
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ jobs:
ATLAS_TOKEN: ${{ secrets.ATLAS_TOKEN }}
run: make vagrantcloud-create

- name: Delete Old Vagrant Cloud Box Version
env:
ATLAS_TOKEN: ${{ secrets.ATLAS_TOKEN }}
run: make vagrantcloud-delete

- name: Setup `packer`
uses: hashicorp/setup-packer@main
id: setup
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ vagrantcloud-create: ## Create Vagrant Cloud box
https://app.vagrantup.com/api/v2/boxes \
--data '{ "box": { "username": "'"${REPO_NAME}"'", "name": "'"${BOX_NAME}"'", "is_private": false } }'

vagrantcloud-release: ## Release Vagrant CLoude box
vargarntcloud-delete: ## Delete old Vagrant Cloud box
@curl \
--request DELETE \
--header "Authorization: Bearer ${ATLAS_TOKEN}" \
"https://app.vagrantup.com/api/v2/box/${REPO}/version/${CI_VERSION}"

vagrantcloud-release: ## Release Vagrant Cloude box
@curl \
--request PUT \
--header "Authorization: Bearer ${ATLAS_TOKEN}" \
Expand Down

0 comments on commit f1c6976

Please sign in to comment.