From caf5ef7c00c40bb7fe286d5b6b14c5d70e30979c Mon Sep 17 00:00:00 2001 From: sophia Date: Mon, 31 Aug 2020 18:07:11 -0500 Subject: [PATCH] Get installer per release tag --- .ci/spec/create-hosts.sh | 14 +++++++------- .github/workflows/spectesting.yml | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.ci/spec/create-hosts.sh b/.ci/spec/create-hosts.sh index 5a408909e..93b5691a1 100755 --- a/.ci/spec/create-hosts.sh +++ b/.ci/spec/create-hosts.sh @@ -25,13 +25,13 @@ wrap aws s3 cp "${ASSETS_PRIVATE_BUCKET}/hashicorp/vagrant-spec/vagrant-spec.gem "Could not download vagrant-spec.gem from s3 asset bucket" ### -# Grab vagrant installer place inside root dir of Vagrant repo -# TODO: Have this variable set -VAGRANT_INSTALLER_VERSION="2.2.11" -# TODO: Get release by reference -INSTALLER_URL=`curl -s https://api.github.com/repos/hashicorp/vagrant-installers/releases | jq -r --arg installer_name "vagrant_${VAGRANT_INSTALLER_VERSION}_x86_64.deb" '.[0].assets[] | select(.name == $installer_name) | .url'` - -wrap curl -Lso ./vagrant_${VAGRANT_INSTALLER_VERSION}_x86_64.deb ${INSTALLER_URL} \ +# Grab vagrant installer and place inside root dir of Vagrant repo +if [ -z "${VAGRANT_PRERELEASE_VERSION}" ]; then + INSTALLER_URL=`curl -s https://api.github.com/repos/hashicorp/vagrant-installers/releases | jq -r '.[0].assets[] | select(.name | contains("_x86_64.deb")) | .browser_download_url'` +else + INSTALLER_URL=`curl -s https://api.github.com/repos/hashicorp/vagrant-installers/releases/tags/${VAGRANT_PRERELEASE_VERSION} | jq -r '.assets[] | select(.name | contains("_x86_64.deb")) | .browser_download_url'` +fi +wrap wget ${INSTALLER_URL} \ "Could not download vagrant installers" ### diff --git a/.github/workflows/spectesting.yml b/.github/workflows/spectesting.yml index 3404ce081..b08d69a36 100644 --- a/.github/workflows/spectesting.yml +++ b/.github/workflows/spectesting.yml @@ -41,6 +41,7 @@ jobs: env: VAGRANT_HOST_BOXES: ${{matrix.host_os}} VAGRANT_GUEST_BOXES: ${{matrix.guest_os}} + VAGRANT_PRERELEASE_VERSION: ${{ github.event.client_payload.prerelease_version }} spec-tests: if: github.repository == 'hashicorp/vagrant-blackbox'