-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprovision-containerd-spin.sh
More file actions
23 lines (20 loc) · 933 Bytes
/
provision-containerd-spin.sh
File metadata and controls
23 lines (20 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
set -euxo pipefail
# see https://github.com/spinkube/containerd-shim-spin
# renovate: datasource=github-releases depName=spinkube/containerd-shim-spin
CONTAINERD_SHIM_SPIN_VERSION='0.22.0'
# bail when already installed.
if [ -x /usr/local/bin/containerd-shim-spin-v2 ]; then
# e.g. Version: 0.22.0
actual_version="$(/usr/local/bin/containerd-shim-spin-v2 -v | perl -ne '/^\s*Version: (.+)/ && print $1')"
if [ "$actual_version" == "$CONTAINERD_SHIM_SPIN_VERSION" ]; then
echo 'ANSIBLE CHANGED NO'
exit 0
fi
fi
# download and install.
containerd_shim_spin_url="https://github.com/spinkube/containerd-shim-spin/releases/download/v${CONTAINERD_SHIM_SPIN_VERSION}/containerd-shim-spin-v2-linux-x86_64.tar.gz"
t="$(mktemp -q -d --suffix=.containerd-shim-spin)"
wget -qO- "$containerd_shim_spin_url" | tar xzf - -C "$t"
install -m 755 "$t/containerd-shim-spin-v2" /usr/local/bin/
rm -rf "$t"