wip3
This commit is contained in:
+47
-24
@@ -1,33 +1,56 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
##makedesc: Install tilt (k8s dev env)
|
||||
|
||||
mkdir -p ~/install/tilt ~/.local/bin
|
||||
cd ~/install/tilt
|
||||
set -eo pipefail
|
||||
|
||||
KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)
|
||||
curl -LO "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl"
|
||||
curl -LO "https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/amd64/kubectl.sha256"
|
||||
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
|
||||
chmod +x kubectl
|
||||
cp ./kubectl ~/.local/bin/kubectl
|
||||
installed() { command -v "$1" >/dev/null 2>&1; }
|
||||
|
||||
################################################################################
|
||||
isMac() { [ "$(uname -s)" = "Darwin" ]; }
|
||||
|
||||
CTLPTL_URL=$(curl -s "https://api.github.com/repos/tilt-dev/ctlptl/releases/latest" \
|
||||
| jq -r '.assets.[] | select(.name | test("linux.x86_64.tar.gz")).browser_download_url')
|
||||
install() {
|
||||
echo
|
||||
echo "==============================================="
|
||||
echo "Installing tilt"
|
||||
echo "==============================================="
|
||||
echo
|
||||
|
||||
curl -fsSL "$CTLPTL_URL" | tar -xz -C ~/.local/bin ctlptl
|
||||
# chmod +x ~/.local/bin/ctlptl
|
||||
mkdir -p ~/install/tilt ~/.local/bin
|
||||
|
||||
################################################################################
|
||||
if isMac; then
|
||||
if installed brew; then
|
||||
brew install kubectl tilt-dev/tap/ctlptl tilt-dev/tap/tilt
|
||||
else
|
||||
echo "ERROR: Install Homebrew first." >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
cd ~/install/tilt
|
||||
|
||||
TILT_URL=$(curl -s "https://api.github.com/repos/tilt-dev/tilt/releases/latest" \
|
||||
| jq -r '.assets.[] | select(.name | test("linux.x86_64.tar.gz")).browser_download_url')
|
||||
KUBECTL_VERSION=$(curl -L -s https://dl.k8s.io/release/stable.txt)
|
||||
curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl"
|
||||
curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256"
|
||||
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
|
||||
chmod +x kubectl
|
||||
cp ./kubectl ~/.local/bin/kubectl
|
||||
|
||||
curl -fsSL "$TILT_URL" | tar -xz -C ~/.local/bin tilt
|
||||
# chmod +x ~/.local/bin/tilt
|
||||
cd -
|
||||
CTLPTL_URL=$(curl -s "https://api.github.com/repos/tilt-dev/ctlptl/releases/latest" \
|
||||
| jq -r '.assets.[] | select(.name | test("linux.x86_64.tar.gz")).browser_download_url')
|
||||
curl -fsSL "$CTLPTL_URL" | tar -xz -C ~/.local/bin ctlptl
|
||||
|
||||
echo "Version of ctlptl = $(ctlptl version)"
|
||||
echo "Version of tilt = $(tilt version)"
|
||||
echo "Version of kubectl:"
|
||||
kubectl version
|
||||
TILT_URL=$(curl -s "https://api.github.com/repos/tilt-dev/tilt/releases/latest" \
|
||||
| jq -r '.assets.[] | select(.name | test("linux.x86_64.tar.gz")).browser_download_url')
|
||||
curl -fsSL "$TILT_URL" | tar -xz -C ~/.local/bin tilt
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Finish!"
|
||||
echo "ctlptl version = $(ctlptl version)"
|
||||
echo "tilt version = $(tilt version)"
|
||||
echo "kubectl version:"
|
||||
kubectl version
|
||||
echo
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
*) install ;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user