forked from PinSpace-Org/GistPin
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfetch-cilium.sh
More file actions
executable file
路32 lines (27 loc) 路 979 Bytes
/
Copy pathfetch-cilium.sh
File metadata and controls
executable file
路32 lines (27 loc) 路 979 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env bash
#
# Fetch the Cilium CLI binary on demand (instead of committing the ~71MB
# tarball into the repo). Run this in CI or locally before using `cilium`.
#
# Usage:
# ./scripts/fetch-cilium.sh [version]
# Example:
# ./scripts/fetch-cilium.sh v0.16.16
#
set -euo pipefail
CILIUM_CLI_VERSION="${1:-${CILIUM_CLI_VERSION:-v0.16.16}}"
ARCH="amd64"
OS="linux"
TARBALL="cilium-${OS}-${ARCH}.tar.gz"
BASE_URL="https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}"
echo "Downloading Cilium CLI ${CILIUM_CLI_VERSION} (${OS}/${ARCH})..."
curl -fsSL --remote-name-all \
"${BASE_URL}/${TARBALL}" \
"${BASE_URL}/${TARBALL}.sha256sum"
echo "Verifying checksum..."
sha256sum --check "${TARBALL}.sha256sum"
echo "Extracting cilium binary..."
tar xzvf "${TARBALL}"
rm -f "${TARBALL}" "${TARBALL}.sha256sum"
echo "Done. 'cilium' binary is in the current directory."
echo "Move it onto your PATH if desired, e.g.: sudo mv cilium /usr/local/bin/"