|
92 | 92 | NAME="${BUILD%-*}"
|
93 | 93 |
|
94 | 94 | # Check if the boxes (virtualbox/libvirt) with the same git hash already exists
|
95 |
| - CURRENT_VERSION_DESCRIPTION_MARKDOWN="$(curl -L --silent "https://app.vagrantup.com/api/v1/box/${VAGRANT_CLOUD_USER}/${NAME}" | jq '.current_version.version as $current_version | .versions[] | select (.version == $current_version) .description_markdown')" |
| 95 | + if curl -s "https://app.vagrantup.com/${VAGRANT_CLOUD_USER}/boxes/${NAME}" | grep -q "Not found" ; then |
| 96 | + CURRENT_VERSION_DESCRIPTION_MARKDOWN="Box doesn't exist" |
| 97 | + else |
| 98 | + CURRENT_VERSION_DESCRIPTION_MARKDOWN="$(curl -L --silent "https://app.vagrantup.com/api/v1/box/${VAGRANT_CLOUD_USER}/${NAME}" | jq '.current_version.version as $current_version | .versions[] | select (.version == $current_version) .description_markdown')" |
| 99 | + fi |
96 | 100 | if [[ "${CURRENT_VERSION_DESCRIPTION_MARKDOWN}" =~ ${GITHUB_SHA} ]] ; then
|
97 | 101 | echo "*** Git hash \"${GITHUB_SHA}\" found in current markdown description"
|
98 | 102 | # Skip build if the box already exists
|
@@ -198,16 +202,16 @@ jobs:
|
198 | 202 | if [[ "${NAME}" =~ ubuntu-.*-desktop-amd64 ]] && [[ "${VAGRANT_PROVIDER}" = "libvirt" ]] ; then
|
199 | 203 | continue
|
200 | 204 | fi
|
201 |
| - CURRENT_VERSION=$(curl -s https://app.vagrantup.com/api/v1/box/peru/${NAME} | jq -r ".current_version.version") |
202 |
| - CHECKSUM=$(curl -s https://app.vagrantup.com/api/v1/box/peru/${NAME} | jq -r ".current_version.providers[] | select (.name == \"${VAGRANT_PROVIDER}\") .checksum") |
203 |
| - URL="https://app.vagrantup.com/peru/boxes/${NAME}/versions/${CURRENT_VERSION}/providers/${VAGRANT_PROVIDER}.box" |
| 205 | + CURRENT_VERSION=$(curl -s "https://app.vagrantup.com/api/v1/box/${VAGRANT_CLOUD_USER}/${NAME}" | jq -r ".current_version.version") |
| 206 | + CHECKSUM=$(curl -s "https://app.vagrantup.com/api/v1/box/${VAGRANT_CLOUD_USER}/${NAME}" | jq -r ".current_version.providers[] | select (.name == \"${VAGRANT_PROVIDER}\") .checksum") |
| 207 | + URL="https://app.vagrantup.com/${VAGRANT_CLOUD_USER}/boxes/${NAME}/versions/${CURRENT_VERSION}/providers/${VAGRANT_PROVIDER}.box" |
204 | 208 | echo "*** ${URL} | ${CHECKSUM}"
|
205 | 209 | if ! curl -L --fail --silent --head --output /dev/null "${URL}"; then
|
206 | 210 | echo "* URL \"${URL}\" is not accessible !"
|
207 | 211 | exit 1
|
208 | 212 | fi
|
209 |
| - if [ "$(curl -s "https://app.vagrantup.com/peru/boxes/${NAME}" | jq '.versions | length')" != "1" ]; then |
210 |
| - echo "* Too many versions for: https://app.vagrantup.com/peru/boxes/${NAME} !" |
| 213 | + if [ "$(curl -s "https://app.vagrantup.com/${VAGRANT_CLOUD_USER}/boxes/${NAME}" | jq '.versions | length')" != "1" ]; then |
| 214 | + echo "* Too many versions for: https://app.vagrantup.com/${VAGRANT_CLOUD_USER}/boxes/${NAME} !" |
211 | 215 | exit 2
|
212 | 216 | fi
|
213 | 217 | done
|
|
0 commit comments