-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from hmrc/BDOG-2696
BDOG-2696 add install script
- Loading branch information
Showing
3 changed files
with
50 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
TARGET_OS="linux" | ||
TARGET_ARCH="intel" | ||
TARGET_VERSION="1.0.9" | ||
|
||
if [[ "$(uname)" == "Darwin" ]]; then | ||
TARGET_OS="apple" | ||
fi | ||
|
||
if [[ "$(uname -p)" == "arm" ]]; then | ||
TARGET_ARCH="arm64" | ||
fi | ||
|
||
echo "Downloading sm2 v$TARGET_VERSION..." | ||
|
||
cd && | ||
curl -s -L -O "https://github.com/hmrc/sm2/releases/download/v$TARGET_VERSION/sm2-$TARGET_VERSION-$TARGET_OS-$TARGET_ARCH.zip" && | ||
unzip sm2-$TARGET_VERSION-$TARGET_OS-$TARGET_ARCH.zip && rm sm2-$TARGET_VERSION-$TARGET_OS-$TARGET_ARCH.zip && | ||
chmod +x sm2 | ||
|
||
echo "Moving sm2 to /usr/local/bin..." | ||
|
||
sudo mv ~/sm2 /usr/local/bin/sm2 | ||
|
||
echo "Successfully installed!" | ||
|
||
sm2 --version | ||
|
||
echo "Running sm2 --update..." | ||
|
||
sm2 --update | ||
|
||
if [[ -z "${WORKSPACE}" ]]; then | ||
# shellcheck disable=SC2016 | ||
echo 'Note: Your $WORKSPACE environment variable is not set. Instructions can be found in the user guide:' | ||
echo 'https://github.com/hmrc/sm2/blob/main/USERGUIDE.md#setup' | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters