Skip to content

Commit

Permalink
bring back kubectl
Browse files Browse the repository at this point in the history
  • Loading branch information
liorbrauer committed Nov 7, 2022
1 parent 60abb18 commit 976736b
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,36 @@ BUILD_DIR=$1
CACHE_DIR=$2
ENV_DIR=$3

KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)

# Download and install kubectl
echo "Installing kubectl version $KUBECTL_VERSION"
DOWNLOAD_URL="https://storage.googleapis.com/kubernetes-release/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl"
mkdir -p "$CACHE_DIR/kubectl/$KUBECTL_VERSION"
KUBECTL_CACHE_FILE="$CACHE_DIR/kubectl/$KUBECTL_VERSION/kubectl"

if [ ! -e "$KUBECTL_CACHE_FILE" ]; then
echo "Downloading kubectl"
curl --silent --show-error -o "$KUBECTL_CACHE_FILE" "$DOWNLOAD_URL"
chmod +x "$KUBECTL_CACHE_FILE"
else
echo "Restoring cached kubectl binary"
fi

mkdir -p "$BUILD_DIR/.heroku/kubectl/bin"
cp -a "$KUBECTL_CACHE_FILE" "$BUILD_DIR/.heroku/kubectl/bin/"

mkdir -p "$BUILD_DIR/.profile.d"
cat > "$BUILD_DIR/.profile.d/kubectl.sh" <<'KUBECTL'
export PATH="$HOME/.heroku/kubectl/bin:$PATH"
if [ ! -z "$KUBECONFIG_BASE64" ]; then
mkdir -p "$HOME/.kube"
echo "$KUBECONFIG_BASE64" | base64 -d > "$HOME/.kube/config"
fi
KUBECTL


# Download and install helm

HELM_VERSION="v3.10.1"
Expand Down

0 comments on commit 976736b

Please sign in to comment.