Skip to content

Commit

Permalink
fix(install): Fix Debian post installation script when awscli2 is alr…
Browse files Browse the repository at this point in the history
…eady installed or the installation failed previously (#6276)
  • Loading branch information
ashleykleynhans authored Aug 20, 2024
1 parent 037113a commit 35a30d3
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions clouddriver-web/pkg_scripts/postInstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,24 @@ install_kubectl() {
}

install_awscli2() {
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWS_CLI_VERSION}.zip" -o "awscliv2.zip"
unzip awscliv2.zip
./aws/install
rm -rf ./awscliv2.zip ./aws
if [ -d "/usr/local/aws-cli/v2/${AWS_CLI_VERSION}" ]; then
echo "awscli2 ${AWS_CLI_VERSION} is already installed"
else
echo "Installing awscli2 ${AWS_CLI_VERSION}"
curl -s "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-${AWS_CLI_VERSION}.zip" -o "awscliv2.zip"

# This shouldn't usually exist unless the installation failed previously
if [ -d "./aws" ]; then
rm -rf ./aws
fi

unzip awscliv2.zip
./aws/install --update
rm -rf ./awscliv2.zip ./aws
fi

curl "https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v${AWS_AIM_AUTHENTICATOR_VERSION}/aws-iam-authenticator_${AWS_AIM_AUTHENTICATOR_VERSION}_linux_amd64" -o aws-iam-authenticator
echo "Installing aws-iam-authenticator ${AWS_AIM_AUTHENTICATOR_VERSION}"
curl -s "https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/download/v${AWS_AIM_AUTHENTICATOR_VERSION}/aws-iam-authenticator_${AWS_AIM_AUTHENTICATOR_VERSION}_linux_amd64" -o aws-iam-authenticator
chmod +x ./aws-iam-authenticator
mv ./aws-iam-authenticator /usr/local/bin/aws-iam-authenticator
}
Expand Down

0 comments on commit 35a30d3

Please sign in to comment.