Skip to content

Commit a2fbe95

Browse files
committed
install replicated cli
1 parent a33b999 commit a2fbe95

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

.github/workflows/wg-easy-pr-validation.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ jobs:
6565
-O /usr/local/bin/yq
6666
sudo chmod +x /usr/local/bin/yq
6767
68+
- name: Install Replicated CLI
69+
run: task utils:install-replicated-cli
70+
6871
- name: Run task ${{ matrix.task }}
6972
run: task ${{ matrix.task }}
7073
timeout-minutes: 10

applications/wg-easy/taskfiles/utils.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,73 @@
11
version: "3"
22

33
tasks:
4+
install-replicated-cli:
5+
desc: Install the latest Replicated CLI binary
6+
silent: false
7+
run: once
8+
status:
9+
- command -v replicated >/dev/null 2>&1
10+
cmds:
11+
- |
12+
echo "Installing Replicated CLI..."
13+
14+
# Detect OS and architecture
15+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
16+
ARCH=$(uname -m)
17+
18+
# Map architecture names
19+
case $ARCH in
20+
x86_64)
21+
ARCH="amd64"
22+
;;
23+
aarch64|arm64)
24+
ARCH="arm64"
25+
;;
26+
*)
27+
echo "Unsupported architecture: $ARCH"
28+
exit 1
29+
;;
30+
esac
31+
32+
echo "Detected OS: $OS, Architecture: $ARCH"
33+
34+
# Download and install based on OS
35+
if [ "$OS" = "linux" ]; then
36+
echo "Downloading Replicated CLI for Linux..."
37+
curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
38+
| grep "browser_download_url.*linux_${ARCH}.tar.gz" \
39+
| cut -d '"' -f 4 \
40+
| xargs curl -L -o replicated.tar.gz
41+
42+
tar xzf replicated.tar.gz
43+
sudo mv replicated /usr/local/bin/replicated
44+
rm -f replicated.tar.gz
45+
46+
elif [ "$OS" = "darwin" ]; then
47+
echo "Downloading Replicated CLI for macOS..."
48+
curl -s https://api.github.com/repos/replicatedhq/replicated/releases/latest \
49+
| grep "browser_download_url.*darwin_${ARCH}.tar.gz" \
50+
| cut -d '"' -f 4 \
51+
| xargs curl -L -o replicated.tar.gz
52+
53+
tar xzf replicated.tar.gz
54+
sudo mv replicated /usr/local/bin/replicated
55+
rm -f replicated.tar.gz
56+
57+
else
58+
echo "Unsupported operating system: $OS"
59+
echo "Please install manually from: https://docs.replicated.com/reference/replicated-cli-installing"
60+
exit 1
61+
fi
62+
63+
# Verify installation
64+
if command -v replicated >/dev/null 2>&1; then
65+
echo "Replicated CLI installed successfully!"
66+
replicated version
67+
else
68+
echo "Failed to install Replicated CLI"
69+
exit 1
70+
fi
471
get-kubeconfig:
572
desc: Get kubeconfig for the test cluster (internal)
673
internal: true

0 commit comments

Comments
 (0)