Make CDH great (...not again) (#3)
This commit is contained in:
50
scripts/download_cdh.sh
Executable file
50
scripts/download_cdh.sh
Executable file
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
case "$(uname)" in
|
||||
|
||||
"Darwin")
|
||||
SYSTEM="apple-darwin"
|
||||
case $(uname -m) in
|
||||
"arm64")
|
||||
TARGET="aarch64-$SYSTEM"
|
||||
;;
|
||||
"x86_64")
|
||||
TARGET="x86_64-$SYSTEM"
|
||||
;;
|
||||
*)
|
||||
echo "Unsuported target"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"Linux")
|
||||
SYSTEM="unknown-linux-gnu"
|
||||
case $(uname -m) in
|
||||
"x86_64")
|
||||
TARGET="x86_64-$SYSTEM"
|
||||
;;
|
||||
*)
|
||||
echo "Unsuported target"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
echo "Signal number $1 is not processed"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
LATEST_VERSION="v$(curl -s https://raw.githubusercontent.com/allanger/check-da-helm/main/Cargo.toml | awk -F ' = ' '$1 ~ /version/ { gsub(/[\"]/, "", $2); printf("%s",$2) }')"
|
||||
echo "Downloading $LATEST_VERSION"
|
||||
|
||||
RELEASE_NAME=cdh-$LATEST_VERSION-$TARGET
|
||||
RELEASE_URL="https://github.com/allanger/check-da-helm/releases/download/$LATEST_VERSION/$RELEASE_NAME"
|
||||
echo "Link for downloading: $RELEASE_URL"
|
||||
curl -LJO $RELEASE_URL
|
||||
|
||||
mv $RELEASE_NAME cdh
|
||||
chmod +x cdh
|
||||
|
||||
echo 'Make sure that cdh is in your $PATH'
|
||||
echo 'Try: '
|
||||
echo ' $ export PATH=$PATH:$PWD'
|
||||
echo ' $ cdh -h'
|
10
scripts/rename_releases.sh
Executable file
10
scripts/rename_releases.sh
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
echo 'renaming cdh to cdh-$VERSION-$SYSTEM format'
|
||||
mkdir -p release
|
||||
echo "version - $CDH_VERSION"
|
||||
for BUILD in build*; do
|
||||
SYSTEM=$(echo $BUILD | sed -e 's/build-//g')
|
||||
echo "system - $SYSTEM"
|
||||
cp $BUILD/cdh release/cdh-$CDH_VERSION-$SYSTEM
|
||||
done
|
||||
ls release
|
Reference in New Issue
Block a user