Skip to content

Instantly share code, notes, and snippets.

@imesh
Last active September 22, 2020 11:04
Show Gist options
  • Save imesh/1a264e5a7b4adcd159170672e4b667ae to your computer and use it in GitHub Desktop.
Save imesh/1a264e5a7b4adcd159170672e4b667ae to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
export KPT_VERSION='v0.33.0'
export APIGEE_CTL_VERSION='1.3.2'
OS_NAME=$(uname -s)
if [[ "$OS_NAME" == "Linux" ]]; then
echo "🐧 Using Linux binaries"
export APIGEE_CTL='apigeectl_linux_64.tar.gz'
export ISTIO_ASM_CLI='istio-1.5.9-asm.0-linux.tar.gz'
export KPT_BINARY='kpt_linux_amd64_0.33.0.tar.gz'
elif [[ "$OS_NAME" == "Darwin" ]]; then
echo "🍏 Using macOS binaries"
export APIGEE_CTL='apigeectl_mac_64.tar.gz'
export ISTIO_ASM_CLI='istio-1.5.9-asm.0-osx.tar.gz'
export KPT_BINARY='kpt_darwin_amd64_0.33.0.tar.gz'
else
echo "💣 Only Linux and macOS are supported at this time. You seem to be running on $OS_NAME."
exit 2
fi
echo "Verifying prerequisites..."
kubectl version
tar --help
openssl version
gcloud auth list
mkdir /tmp/hybrid
pushd /tmp/hybrid
echo "🏗️ Downloading Anthos Service Mesh..."
mkdir -p ./tools/istio-asm
curl -L -o ./tools/istio-asm/istio-asm.tar.gz "https://storage.googleapis.com/gke-release/asm/${ISTIO_ASM_CLI}"
tar xzf ./tools/istio-asm/istio-asm.tar.gz -C ./tools/istio-asm
mv ./tools/istio-asm/istio-*/* ./tools/istio-asm/.
./tools/istio-asm/bin/istioctl
mkdir -p ./tools/kpt
echo "🏗️ Downloading KPT..."
curl -L -o ./tools/kpt/kpt.tar.gz "https://github.com/GoogleContainerTools/kpt/releases/download/${KPT_VERSION}/${KPT_BINARY}"
tar xzf ./tools/kpt/kpt.tar.gz -C ./tools/kpt
./tools/kpt/kpt
export APIGEECTL_HOME=$PWD/tools/apigeectl/apigeectl_$APIGEE_CTL_VERSION
mkdir -p ./tools/apigeectl
echo "🏗️ Downloading Apigee Hybrid CLI (apigeectl)..."
curl -L \
-o ./tools/apigeectl/apigeectl.tar.gz \
"https://storage.googleapis.com/apigee-public/apigee-hybrid-setup/$APIGEE_CTL_VERSION/$APIGEE_CTL"
tar xvzf ./tools/apigeectl/apigeectl.tar.gz -C ./tools/apigeectl
rm ./tools/apigeectl/apigeectl.tar.gz
mkdir -p $APIGEECTL_HOME
mv ./tools/apigeectl/apigeectl_*_64/* $APIGEECTL_HOME
rm -fd ./tools/apigeectl/apigeectl_*_64
$APIGEECTL_HOME/apigeectl
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment