minor fixes

This commit is contained in:
Dibir Magomedsaygitov
2020-07-07 17:25:41 +03:00
parent df8858b77f
commit 845dc20aeb

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
################################################################################ ################################################################################
## File: oras-cli.sh ## File: oras-cli.sh
## Desc: Installs ORAS Cli ## Desc: Installs ORAS CLI
################################################################################ ################################################################################
# Source the helpers for use with the script # Source the helpers for use with the script
@@ -10,13 +10,14 @@ source $HELPER_SCRIPTS/document.sh
# Determine latest ORAS CLI version # Determine latest ORAS CLI version
ORAS_CLI_LATEST_VERSION_URL=https://api.github.com/repos/deislabs/oras/releases/latest 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_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"
# Install ORAS CLI # Install ORAS CLI
curl -LO https://github.com/deislabs/oras/releases/download/v${ORAS_CLI_VERSION}/oras_${ORAS_CLI_VERSION}_linux_amd64.tar.gz curl -LO https://github.com/deislabs/oras/releases/download/v${ORAS_CLI_VERSION}/${ORAS_CLI_ARCHIVE}
mkdir -p oras-install/ mkdir -p oras-install/
tar -xzvf oras_${ORAS_CLI_VERSION}_linux_amd64.tar.gz -C oras-install/ tar -xzvf $ORAS_CLI_ARCHIVE -C oras-install/
mv oras-install/oras /usr/local/bin/ mv oras-install/oras /usr/local/bin/
rm -rf oras_${ORAS_CLI_VERSION}_linux_amd64.tar.gz oras-install/ rm -rf $ORAS_CLI_ARCHIVE oras-install/
# Run tests to determine that the software installed as expected # Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work" echo "Testing to make sure that script performed as expected, and basic scenarios work"