mirror of https://github.com/zulip/zulip.git
install-aws-cli: Check version before no-op'ing.
We previously just ensured that _a_ version was installed. Since we were only using this at initial boot, that was all that was required.
This commit is contained in:
parent
bd87f53c86
commit
e49fc8873b
|
@ -14,18 +14,26 @@ else
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d "/srv/zulip-aws-tools/v2/$AWS_CLI_VERSION" ]; then
|
||||
mkdir -p /srv/zulip-aws-tools
|
||||
(
|
||||
cd /srv/zulip-aws-tools || exit 1
|
||||
rm -rf awscli.zip awscli.zip.sha256 aws/
|
||||
curl -fL --retry 3 "https://awscli.amazonaws.com/awscli-exe-linux-$ARCH-$AWS_CLI_VERSION.zip" -o awscli.zip
|
||||
echo "$AWS_CLI_SHA awscli.zip" >awscli.zip.sha256
|
||||
sha256sum -c awscli.zip.sha256
|
||||
unzip -q awscli.zip
|
||||
|
||||
cd ./aws || exit 1
|
||||
./install -i /srv/zulip-aws-tools -b /srv/zulip-aws-tools/bin -u
|
||||
)
|
||||
rm -rf awscli.zip awscli.zip.sha256 aws/
|
||||
# Check if we're already installed
|
||||
if [ -L "/srv/zulip-aws-tools/v2/current" ] \
|
||||
&& [ "$(readlink /srv/zulip-aws-tools/v2/current)" = "/srv/zulip-aws-tools/v2/$AWS_CLI_VERSION" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -p /srv/zulip-aws-tools
|
||||
|
||||
cd /srv/zulip-aws-tools || exit 1
|
||||
rm -rf awscli.zip awscli.zip.sha256 aws/
|
||||
curl -fL --retry 3 "https://awscli.amazonaws.com/awscli-exe-linux-$ARCH-$AWS_CLI_VERSION.zip" -o awscli.zip
|
||||
echo "$AWS_CLI_SHA awscli.zip" >awscli.zip.sha256
|
||||
sha256sum -c awscli.zip.sha256
|
||||
unzip -q awscli.zip
|
||||
|
||||
cd ./aws || exit 1
|
||||
./install -i /srv/zulip-aws-tools -b /srv/zulip-aws-tools/bin -u
|
||||
echo "$AWS_CLI_VERSION" >/srv/zulip-aws-tools/version
|
||||
|
||||
(
|
||||
cd /srv/zulip-aws-tools/
|
||||
rm -rf awscli.zip awscli.zip.sha256 aws/
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue