File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -17,28 +17,39 @@ if [ -z ${COSCALE_TOKEN+x} ]; then
1717fi
1818
1919# Fetch latest release list from Github
20+ echo " Getting latest release information"
2021github_data=` curl -s -L https://api.github.com/repos/CoScale/coscale-cli/releases/latest | python -c ' import json,sys;obj=json.load(sys.stdin); releases = [release["browser_download_url"] for release in obj["assets"]]; print "\n".join(releases)' `
2122
2223# Detect operation system
24+ echo " Detecting operation system"
2325os=` uname -o | awk ' {split($0,a,"/"); print tolower(a[2])}' `
2426
2527# Select correct release
2628release=` echo " $github_data " | grep $os `
2729
2830# Create dirs
31+ echo " Creating directories /opt/coscale/cli"
2932mkdir -p /opt/coscale/cli
3033pushd /opt/coscale/cli
3134
3235# Install client
36+ echo " Downloading client to /opt/coscale/cli/coscale-cli"
3337curl -L " $release " > coscale-cli
3438chmod +x coscale-cli
3539
3640# Add to $PATH
41+ echo " Adding coscale-cli to $PATH in /root/.bashrc"
3742echo " export PATH=\" ${PATH} :/opt/coscale/cli\" " >> /root/.bashrc
3843source /root/.bashrc
3944
4045# Create config
46+ echo " Creating config"
4147echo " {\" baseurl\" :\" https://api.coscale.com\" , \" appid\" :\" $COSCALE_APPID \" , \" accesstoken\" :\" $COSCALE_TOKEN \" }" | gzip -c > /opt/coscale/cli/api.conf
4248
4349# Test config
50+ echo " Testing configuration"
4451coscale-cli event list
52+
53+ # Done
54+ echo " Done, you can now start using the CoScale CLI tool"
55+ popd
You can’t perform that action at this time.
0 commit comments