From 5f5c60ef989eb60eec6b31271d2daf40f88f1bb9 Mon Sep 17 00:00:00 2001 From: Dibir Magomedsaygitov Date: Tue, 7 Jul 2020 19:14:31 +0300 Subject: [PATCH] minor fixes --- images/linux/scripts/installers/oras-cli.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/images/linux/scripts/installers/oras-cli.sh b/images/linux/scripts/installers/oras-cli.sh index 0381522b8..d23763ad0 100644 --- a/images/linux/scripts/installers/oras-cli.sh +++ b/images/linux/scripts/installers/oras-cli.sh @@ -9,15 +9,15 @@ source $HELPER_SCRIPTS/document.sh # Determine latest ORAS CLI version ORAS_CLI_LATEST_VERSION_URL=https://api.github.com/repos/deislabs/oras/releases/latest -ORAS_CLI_VERSION=$(curl $ORAS_CLI_LATEST_VERSION_URL | jq '.name' | tr -d '"' | cut -d 'v' -f 2) -ORAS_CLI_ARCHIVE="oras_${ORAS_CLI_VERSION}_linux_amd64.tar.gz" +ORAS_CLI_DOWNLOAD_URL=$(curl -s $ORAS_CLI_LATEST_VERSION_URL | jq -r '.assets[].browser_download_url | select(contains("linux_amd64.tar.gz"))') +ORAS_CLI_ARCHIVE=$(basename $ORAS_CLI_DOWNLOAD_URL) # Install ORAS CLI -curl -LO https://github.com/deislabs/oras/releases/download/v${ORAS_CLI_VERSION}/${ORAS_CLI_ARCHIVE} -mkdir -p oras-install/ +cd /tmp +curl -LO $ORAS_CLI_DOWNLOAD_URL -o $ORAS_CLI_ARCHIVE +mkdir -p oras-install tar -xzvf $ORAS_CLI_ARCHIVE -C oras-install/ mv oras-install/oras /usr/local/bin/ -rm -rf $ORAS_CLI_ARCHIVE oras-install/ # Run tests to determine that the software installed as expected echo "Testing to make sure that script performed as expected, and basic scenarios work" @@ -28,4 +28,4 @@ fi # Document what was added to the image echo "Lastly, documenting what we added to the metadata file" -DocumentInstalledItem "ORAS $(oras version | head -1 | awk {'print $2'})" \ No newline at end of file +DocumentInstalledItem "ORAS $(oras version | awk 'NR==1{print $2})" \ No newline at end of file