Skip to content

Commit

Permalink
Fix cleaning old boxes versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzickap committed May 1, 2020
1 parent 05bf00b commit f7f3269
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ jobs:
steps:
- name: Remove old versions
run: |
for NAME in ubuntu-18.04-desktop-amd64 ubuntu-{18.04,16.04}-server-amd64 my_ubuntu-18.04-server-amd64 my_centos-7-x86_64 my_windows-10-enterprise-x64-eval windows-{server-{{2016,2012_r2}-standard,2019-datacenter},10-enterprise}-x64-eval; do
for NAME in ubuntu-{18,20}.04-desktop-amd64 ubuntu-{20,18,16}.04-server-amd64 my_ubuntu-20.04-server-amd64 my_centos-7-x86_64 my_windows-10-enterprise-x64-eval windows-{server-{{2016,2012_r2}-standard,2019-datacenter},10-enterprise}-x64-eval; do
OLD_VERSIONS=$(curl -s "https://app.vagrantup.com/api/v1/box/${VAGRANT_CLOUD_USER}/${NAME}" | jq -r '.current_version.version as $current_version | .versions[] | select (.version != $current_version) .version')
for VERSION in ${OLD_VERSIONS}; do
echo "*** Removing box version: https://vagrantcloud.com/api/v1/box/${VAGRANT_CLOUD_USER}/${NAME}/version/${VERSION}"
Expand All @@ -175,7 +175,7 @@ jobs:
echo "* URL \"${URL}\" is not accessible !"
exit 1
fi
if [ $(curl -s https://app.vagrantup.com/peru/boxes/${NAME} | jq '.versions | length') != "1" ]; then
if [ "$(curl -s "https://app.vagrantup.com/peru/boxes/${NAME}" | jq '.versions | length')" != "1" ]; then
echo "* Too many versions for: https://app.vagrantup.com/peru/boxes/${NAME} !"
exit 2
fi
Expand Down

0 comments on commit f7f3269

Please sign in to comment.