Skip to content

Commit

Permalink
chore(release): 1.0.10 [skip ci]
Browse files Browse the repository at this point in the history
## [1.0.10](v1.0.9...v1.0.10) (2021-10-26)

### Bug Fixes

* Template-ify CLI_VERSION in Makefile ([9dd3521](9dd3521))
  • Loading branch information
semantic-release-bot committed Oct 26, 2021
1 parent 9dd3521 commit 66e44a1
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [1.0.10](https://github.com/usecloudstate/cli/compare/v1.0.9...v1.0.10) (2021-10-26)


### Bug Fixes

* Template-ify CLI_VERSION in Makefile ([9dd3521](https://github.com/usecloudstate/cli/commit/9dd352116ec78318ec3ae8b7430ed46a0cbad1a8))

## [1.0.9](https://github.com/usecloudstate/cli/compare/v1.0.8...v1.0.9) (2021-10-26)


Expand Down
72 changes: 72 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash
{
set -e
SUDO=''
if [ "$(id -u)" != "0" ]; then
SUDO='sudo'
echo "This script requires superuser access."
echo "You will be prompted for your password by sudo."
# clear any previous sudo permission
sudo -k
fi


# run inside sudo
$SUDO bash <<SCRIPT
set -e
echoerr() { echo "\$@" 1>&2; }
if [[ ! ":\$PATH:" == *":/usr/local/bin:"* ]]; then
echoerr "Your path is missing /usr/local/bin, you need to add this to use this installer."
exit 1
fi
if [ "\$(uname)" == "Darwin" ]; then
OS=darwin
elif [ "\$(expr substr \$(uname -s) 1 5)" == "Linux" ]; then
OS=linux
else
echoerr "This installer is only supported on Linux and MacOS"
exit 1
fi
ARCH="\$(uname -m)"
if [ "\$ARCH" == "x86_64" ]; then
ARCH=amd64
elif [[ "\$ARCH" == aarch* ]]; then
ARCH=arm
else
echoerr "unsupported arch: \$ARCH"
exit 1
fi
mkdir -p /usr/local/lib
cd /usr/local/lib
rm -rf cloudstate
rm -rf ~/.local/share/cloudstate/client
mkdir -p cloudstate/bin
cd cloudstate/bin
URL="https://github.com/usecloudstate/cli/releases/download/v1.0.10/cloudstate-cli-\$OS-\$ARCH"
echo "Installing CLI from \$URL"
if [ \$(command -v curl) ]; then
curl -L "\$URL" --output cli
else
wget -O- "\$URL" > cli
fi
# delete old cloudstate bin if exists
rm -f \$(command -v cloudstate) || true
rm -f /usr/local/bin/cloudstate
ln -s /usr/local/lib/cloudstate/bin/cli /usr/local/bin/cloudstate
chmod +x /usr/local/lib/cloudstate/bin/cli
SCRIPT
# test the CLI
LOCATION=$(command -v cloudstate)
echo "cloudstate installed to $LOCATION"
}

0 comments on commit 66e44a1

Please sign in to comment.