From 7fa03902b428eab18296294dde3bb966ad9d0be8 Mon Sep 17 00:00:00 2001 From: Hui Zhu Date: Mon, 25 Mar 2019 10:40:38 +0800 Subject: [PATCH 1/2] ci: set $yq_version to 2.3.0 According what I said in https://github.com/kata-containers/tests/issues/1349, use the last verion is not a good choice. This commit set it to 2.3.0. Fixes: #1411 Signed-off-by: Hui Zhu --- .ci/install-yq.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.ci/install-yq.sh b/.ci/install-yq.sh index 03dd85e66..794cbd726 100755 --- a/.ci/install-yq.sh +++ b/.ci/install-yq.sh @@ -56,12 +56,7 @@ function install_yq() { die "Please install curl" fi - # Workaround to get latest release from github (to not use github token). - # Get the redirection to latest release on github. - yq_latest_url=$(curl -Ls -o /dev/null -w %{url_effective} "https://${yq_pkg}/releases/latest") - # The redirected url should include the latest release version - # https://github.com/mikefarah/yq/releases/tag/ - yq_version=$(basename "${yq_latest_url}") + local yq_version=2.3.0 local yq_url="https://${yq_pkg}/releases/download/${yq_version}/yq_${goos}_${goarch}" curl -o "${yq_path}" -LSs ${yq_url} From 4993dfffe665967cc66792dbc7193e59afc97b99 Mon Sep 17 00:00:00 2001 From: Hui Zhu Date: Mon, 25 Mar 2019 11:25:07 +0800 Subject: [PATCH 2/2] ci: Add a failed execution check for curl There is no checks for curl get 404 or something else. Add a check for it. Fixes: #1411 Signed-off-by: Hui Zhu --- .ci/install-yq.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.ci/install-yq.sh b/.ci/install-yq.sh index 794cbd726..6ef58b368 100755 --- a/.ci/install-yq.sh +++ b/.ci/install-yq.sh @@ -59,7 +59,8 @@ function install_yq() { local yq_version=2.3.0 local yq_url="https://${yq_pkg}/releases/download/${yq_version}/yq_${goos}_${goarch}" - curl -o "${yq_path}" -LSs ${yq_url} + curl -o "${yq_path}" -LSsf ${yq_url} + [ $? -ne 0 ] && die "Download ${yq_url} failed" chmod +x ${yq_path} if ! command -v "${yq_path}" >/dev/null; then