rig dep update
This commit is contained in:
@@ -7,8 +7,9 @@
|
||||
#
|
||||
# What it will not do, deliberately:
|
||||
#
|
||||
# * no sudo, no apt, no yum. It writes ONLY into $OUT_BIN (default
|
||||
# ~/.local/bin). Everything needing root — installing Docker, joining the
|
||||
# * no sudo, no apt, no yum. It writes into $OUT_BIN (default ~/.local/bin)
|
||||
# and, for compose only, a symlink under ~/.docker/cli-plugins — both in
|
||||
# your own home. Everything needing root — installing Docker, joining the
|
||||
# docker group, raising inotify limits — is REPORTED for you to decide on.
|
||||
# That is what makes it safe to run on a machine that already works.
|
||||
# * no unverified download. Every artifact is checked against a SHA256 taken
|
||||
@@ -72,8 +73,16 @@ JQ_VERSION=1.8.2
|
||||
JQ_SHA256=b1c22172dd303f3be49e935aa56aa48a8b7a46e0bc838b4997d3bb451495870f
|
||||
JQ_URL="https://github.com/jqlang/jq/releases/download/jq-${JQ_VERSION}/jq-linux-amd64"
|
||||
|
||||
# Distro docker packages ship the daemon and CLI but frequently not this, so
|
||||
# `docker compose up` fails with "unknown command" on an otherwise working
|
||||
# Docker. It is a CLI plugin: the binary is found by name in a plugin directory,
|
||||
# which is why install_compose_plugin links it into ~/.docker/cli-plugins.
|
||||
COMPOSE_VERSION=5.5.1
|
||||
COMPOSE_SHA256=db1889184726840f75c4f9c001048430d4f25b3be3cb084d3ddd762bc0aed576
|
||||
COMPOSE_URL="https://github.com/docker/compose/releases/download/v${COMPOSE_VERSION}/docker-compose-linux-x86_64"
|
||||
|
||||
CORE_TOOLS="kubectl jq"
|
||||
DEV_TOOLS="kind tilt ctlptl"
|
||||
DEV_TOOLS="kind tilt ctlptl docker-compose"
|
||||
|
||||
# No helm: every rig addon installs with `kubectl apply -f`, so nothing has ever
|
||||
# invoked it. Add it the day something actually needs a chart.
|
||||
@@ -305,6 +314,14 @@ detect_docker() {
|
||||
fi
|
||||
if docker info >/dev/null 2>&1; then
|
||||
echo " docker $(docker version --format '{{.Server.Version}}' 2>/dev/null)"
|
||||
# Distro packages routinely omit the compose plugin, so a working
|
||||
# daemon says nothing about whether `docker compose up` will run.
|
||||
if docker compose version >/dev/null 2>&1; then
|
||||
echo " compose $(docker compose version --short 2>/dev/null)"
|
||||
else
|
||||
echo " ! no 'docker compose' plugin — compose files will not start."
|
||||
echo " The dev tier installs one; no root needed."
|
||||
fi
|
||||
local n
|
||||
n=$(docker ps --filter "label=io.x-k8s.kind.cluster" --format '{{.Names}}' 2>/dev/null | wc -l)
|
||||
# Must be an `if`, not `[ ] && echo`: as the last statement here the
|
||||
@@ -411,7 +428,30 @@ fetch() {
|
||||
fetch_bin kind "$KIND_URL" "$KIND_SHA256" "$dest"
|
||||
fetch_tgz tilt "$TILT_URL" "$TILT_SHA256" "$dest" tilt 0
|
||||
fetch_tgz ctlptl "$CTLPTL_URL" "$CTLPTL_SHA256" "$dest" ctlptl 0
|
||||
fetch_bin docker-compose "$COMPOSE_URL" "$COMPOSE_SHA256" "$dest"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# A copy in OUT_BIN only gives you `docker-compose`. The hyphenated form is the
|
||||
# retired v1 spelling; every compose file written in the last few years assumes
|
||||
# `docker compose`, and that resolves plugins by name from this directory.
|
||||
install_compose_plugin() {
|
||||
local src="$OUT_BIN/docker-compose" dir="$HOME/.docker/cli-plugins"
|
||||
[ -x "$src" ] || return 0
|
||||
mkdir -p "$dir"
|
||||
if [ -e "$dir/docker-compose" ] && [ ! -L "$dir/docker-compose" ]; then
|
||||
echo
|
||||
echo " ! $dir/docker-compose exists and is not a symlink — left alone"
|
||||
MANUAL+=("Something already installs the compose plugin at
|
||||
$dir/docker-compose
|
||||
To use the pinned build instead:
|
||||
ln -sf $src $dir/docker-compose")
|
||||
return 0
|
||||
fi
|
||||
ln -sfn "$src" "$dir/docker-compose"
|
||||
echo
|
||||
echo " compose plugin linked into $dir"
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -509,13 +549,18 @@ install() {
|
||||
detect
|
||||
echo
|
||||
fetch "$tier"
|
||||
# An `if`, not `[ ] && ...`: on the core tier the test fails, and under
|
||||
# `set -e` a bare failing test here would end the run silently.
|
||||
if [ "$tier" = "dev" ]; then
|
||||
install_compose_plugin
|
||||
fi
|
||||
echo
|
||||
verify_tools "$tier"
|
||||
warn_shadowing "$tier"
|
||||
|
||||
if [ "$tier" = "core" ]; then
|
||||
echo
|
||||
echo " core tier: no kind, tilt or ctlptl. '$0 install dev' adds them."
|
||||
echo " core tier: no kind, tilt, ctlptl or compose. '$0 install dev' adds them."
|
||||
fi
|
||||
|
||||
case ":${PATH}:" in
|
||||
@@ -541,11 +586,12 @@ install() {
|
||||
|
||||
list() {
|
||||
echo "pinned, linux/amd64 only:"
|
||||
printf ' %-8s %s\n' kubectl "$KUBECTL_VERSION"
|
||||
printf ' %-8s %s\n' jq "$JQ_VERSION"
|
||||
printf ' %-8s %s\n' kind "$KIND_VERSION"
|
||||
printf ' %-8s %s\n' tilt "$TILT_VERSION"
|
||||
printf ' %-8s %s\n' ctlptl "$CTLPTL_VERSION"
|
||||
printf ' %-14s %s\n' kubectl "$KUBECTL_VERSION"
|
||||
printf ' %-14s %s\n' jq "$JQ_VERSION"
|
||||
printf ' %-14s %s\n' kind "$KIND_VERSION"
|
||||
printf ' %-14s %s\n' tilt "$TILT_VERSION"
|
||||
printf ' %-14s %s\n' ctlptl "$CTLPTL_VERSION"
|
||||
printf ' %-14s %s\n' docker-compose "$COMPOSE_VERSION"
|
||||
echo
|
||||
echo " core = $CORE_TOOLS"
|
||||
echo " dev = $CORE_TOOLS $DEV_TOOLS"
|
||||
|
||||
Reference in New Issue
Block a user