Skip to content

Commit

Permalink
add delete function to remove old box version
Browse files Browse the repository at this point in the history
  • Loading branch information
ifurther committed Jan 14, 2024
1 parent fcdae9b commit fd6d238
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,15 @@ jobs:
run: make vagrantcloud-create

- name: Set Vagrant Cloud Box is Public
env:
ATLAS_TOKEN: ${{ secrets.ATLAS_TOKEN }}
run: make vagrantcloud-update

- name: Delete Old Vagrant Cloud Box Version
env:
ATLAS_TOKEN: ${{ secrets.ATLAS_TOKEN }}
run: VERSION=${GITHUB_REF#refs/heads/nixos-} make vagrantcloud-delete

- name: Setup `packer`
uses: hashicorp/setup-packer@main
id: setup
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ 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-delete: ## Delete old Vagrant Cloud box
@curl \
--request DELETE \
--header "Authorization: Bearer ${ATLAS_TOKEN}" \
"https://app.vagrantup.com/api/v2/box/${REPO}/version/${VERSION}"

vagrantcloud-update: ## Create Vagrant Cloud box
@curl \
--request PUT \
Expand Down

0 comments on commit fd6d238

Please sign in to comment.