Skip to content

Commit eb41856

Browse files
committed
add scripts for testing different distros and update install guide
1 parent 356efd8 commit eb41856

File tree

6 files changed

+680
-9
lines changed

6 files changed

+680
-9
lines changed

INSTALLATION.md

Lines changed: 94 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,23 +130,108 @@ asset_filters=["stackit-cli_", "_linux_amd64.tar.gz"]
130130
eget stackitcloud/stackit-cli
131131
```
132132

133-
#### RPM package via dnf, yum and zypper
133+
#### RedHat/Fedora (`dnf`)
134134

135-
The STACKIT CLI is available as [RPM Package](https://github.com/stackitcloud/stackit-cli/releases) and can be installed via dnf, yum and zypper package manager.
135+
The STACKIT CLI can be installed through the `dnf` package manager on modern RedHat-based distributions.
136136

137-
Just download the rpm package from the [release page](https://github.com/stackitcloud/stackit-cli/releases) and run the install command like the following:
137+
**Supported distributions:**
138+
- RHEL 9+
139+
- Fedora 35+
140+
- AlmaLinux 9+
141+
- Rocky Linux 9+
142+
143+
> **Note:** RHEL 8 and older derivatives are not supported due to GPG signature compatibility.
144+
145+
##### Before you begin
146+
147+
To install the STACKIT CLI package, you will need to have the `curl` and `gnupg` packages installed:
148+
149+
```shell
150+
sudo dnf install curl gnupg
151+
```
152+
153+
##### Installing
154+
155+
1. Import the STACKIT public key:
156+
157+
```shell
158+
curl https://packages.stackit.cloud/keys/key.gpg | sudo gpg --dearmor -o /etc/pki/rpm-gpg/RPM-GPG-KEY-stackit
159+
```
160+
161+
2. Add the STACKIT CLI package repository:
162+
163+
```shell
164+
sudo tee /etc/yum.repos.d/stackit.repo << EOF
165+
[stackit]
166+
name=STACKIT CLI Repository
167+
baseurl=https://packages.stackit.cloud/rpm/cli/
168+
enabled=1
169+
gpgcheck=1
170+
repo_gpgcheck=1
171+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-stackit
172+
EOF
173+
```
174+
175+
3. Update repository information and install the `stackit` package:
176+
177+
```shell
178+
sudo dnf update
179+
sudo dnf install stackit
180+
```
181+
182+
#### OpenSUSE (`zypper`)
183+
184+
The STACKIT CLI can be installed through the `zypper` package manager.
185+
186+
**Supported distributions:**
187+
- OpenSUSE Leap 15.4+
188+
- OpenSUSE Tumbleweed
189+
190+
##### Before you begin
191+
192+
To install the STACKIT CLI package, you will need to have the `curl` and `gnupg` packages installed:
193+
194+
```shell
195+
sudo zypper install curl gnupg
196+
```
197+
198+
##### Installing
199+
200+
1. Import the STACKIT public key:
201+
202+
```shell
203+
curl https://packages.stackit.cloud/keys/key.gpg | sudo gpg --dearmor -o /etc/pki/rpm-gpg/RPM-GPG-KEY-stackit
204+
```
205+
206+
2. Add the STACKIT CLI package repository:
207+
208+
```shell
209+
sudo zypper addrepo -g -f https://packages.stackit.cloud/rpm/cli/ stackit
210+
sudo zypper --gpg-auto-import-keys refresh
211+
```
212+
213+
3. Install the `stackit` package:
138214

139215
```shell
140-
dnf install stackitcli.rpm
141-
yum install stackitcli.rpm
142-
zypper install stackitcli.rpm
216+
sudo zypper install stackit
217+
```
218+
219+
#### Manual RPM Installation
220+
221+
Alternatively, you can download the RPM package from the [release page](https://github.com/stackitcloud/stackit-cli/releases) and install it manually:
222+
223+
```shell
224+
# Download and install directly
225+
sudo dnf install https://github.com/stackitcloud/stackit-cli/releases/latest/download/stackit_*_linux_amd64.rpm
226+
227+
# Or download first, then install
228+
wget https://github.com/stackitcloud/stackit-cli/releases/latest/download/stackit_*_linux_amd64.rpm
229+
sudo dnf install stackit_*_linux_amd64.rpm
143230
```
144231

145-
#### Any distribution
232+
> **Note:** Manual RPM installation requires a modern distribution (RHEL 9+, Fedora 35+, AlmaLinux 9+, Rocky Linux 9+) for GPG signature verification.
146233
147-
Alternatively, you can install via [Homebrew](https://brew.sh/) or refer to one of the installation methods below.
148234

149-
> We are currently working on distributing the CLI on more package managers for Linux.
150235

151236
### Windows
152237

scripts/test-almalinux9.sh

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
#!/bin/bash
2+
3+
# Test script for AlmaLinux 9 RPM repository
4+
# Uses test bucket for RPMs, production bucket for GPG key
5+
6+
set -e
7+
8+
echo "=========================================="
9+
echo "STACKIT CLI AlmaLinux 9 RPM Test"
10+
echo "=========================================="
11+
12+
# Configuration
13+
CONTAINER_NAME="stackit-almalinux9-test"
14+
IMAGE="almalinux:9"
15+
16+
# Test environment S3 bucket (for RPMs)
17+
TEST_S3_BUCKET="distribution-test"
18+
TEST_S3_ENDPOINT="object.storage.eu01.onstackit.cloud"
19+
TEST_RPM_REPO_PATH="rpm/cli"
20+
21+
# Production S3 bucket (for GPG key)
22+
PROD_S3_BUCKET="distribution"
23+
PROD_S3_ENDPOINT="object.storage.eu01.onstackit.cloud"
24+
PROD_GPG_KEY_PATH="keys/key.gpg"
25+
26+
echo "Step 1: Starting AlmaLinux 9 container..."
27+
docker run -d --name $CONTAINER_NAME $IMAGE tail -f /dev/null
28+
29+
echo "Step 2: Installing dependencies..."
30+
docker exec $CONTAINER_NAME bash -c "
31+
dnf update -y
32+
dnf install -y --allowerasing curl wget gpg
33+
"
34+
35+
echo "Step 3: Downloading GPG key from production bucket..."
36+
docker exec $CONTAINER_NAME bash -c "
37+
curl -o /tmp/stackit-gpg-signer.asc 'https://$PROD_S3_BUCKET.$PROD_S3_ENDPOINT/$PROD_GPG_KEY_PATH'
38+
gpg --import /tmp/stackit-gpg-signer.asc
39+
echo '✅ GPG key imported'
40+
"
41+
42+
echo "Step 4: Creating repository configuration..."
43+
docker exec $CONTAINER_NAME bash -c "
44+
cat > /etc/yum.repos.d/stackit-cli.repo << EOF
45+
[stackit-cli]
46+
name=STACKIT CLI Repository
47+
baseurl=https://$TEST_S3_BUCKET.$TEST_S3_ENDPOINT/$TEST_RPM_REPO_PATH
48+
enabled=1
49+
gpgcheck=1
50+
repo_gpgcheck=1
51+
gpgkey=https://$PROD_S3_BUCKET.$PROD_S3_ENDPOINT/$PROD_GPG_KEY_PATH
52+
EOF
53+
cat /etc/yum.repos.d/stackit-cli.repo
54+
echo '✅ Repository configuration created'
55+
"
56+
57+
echo "Step 5: Updating package cache..."
58+
docker exec $CONTAINER_NAME bash -c "
59+
dnf clean all
60+
dnf repolist
61+
echo '✅ Package cache updated'
62+
"
63+
64+
echo "Step 6: Installing STACKIT CLI..."
65+
docker exec $CONTAINER_NAME bash -c "
66+
dnf install -y stackit
67+
echo '✅ STACKIT CLI installed'
68+
"
69+
70+
echo "Step 7: Verifying installation..."
71+
docker exec $CONTAINER_NAME bash -c "
72+
if command -v stackit >/dev/null 2>&1; then
73+
echo '✅ stackit command found: \$(which stackit)'
74+
echo '✅ Version: \$(stackit version)'
75+
else
76+
echo '❌ stackit command not found'
77+
exit 1
78+
fi
79+
"
80+
81+
echo "Step 8: Testing basic functionality..."
82+
docker exec $CONTAINER_NAME bash -c "
83+
echo '=== STACKIT CLI HELP OUTPUT ==='
84+
stackit --help
85+
echo '=== END HELP OUTPUT ==='
86+
echo '✅ Basic functionality test passed'
87+
"
88+
89+
echo "Step 9: Testing package update..."
90+
docker exec $CONTAINER_NAME bash -c "
91+
dnf check-update stackit || echo 'No updates available (expected for test)'
92+
echo '✅ Update check completed'
93+
"
94+
95+
echo "Step 10: Uninstalling STACKIT CLI..."
96+
docker exec $CONTAINER_NAME bash -c "
97+
dnf remove -y stackit
98+
echo '✅ STACKIT CLI uninstalled'
99+
"
100+
101+
echo "Step 11: Verifying uninstallation..."
102+
docker exec $CONTAINER_NAME bash -c "
103+
if ! command -v stackit >/dev/null 2>&1; then
104+
echo '✅ stackit command no longer found'
105+
else
106+
echo '❌ stackit command still found: \$(which stackit)'
107+
exit 1
108+
fi
109+
"
110+
111+
echo "Step 12: Cleaning up container..."
112+
docker stop $CONTAINER_NAME
113+
docker rm $CONTAINER_NAME
114+
115+
echo "=========================================="
116+
echo "✅ AlmaLinux 9 RPM test completed successfully!"
117+
echo "=========================================="

scripts/test-fedora.sh

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
#!/bin/bash
2+
3+
# Test script for Fedora RPM repository (test environment)
4+
# Uses test bucket for RPMs, production bucket for GPG key
5+
6+
set -e
7+
8+
echo "=========================================="
9+
echo "STACKIT CLI Fedora RPM Test (Test Environment)"
10+
echo "=========================================="
11+
12+
# Configuration
13+
CONTAINER_NAME="stackit-fedora-test"
14+
IMAGE="fedora:latest"
15+
16+
# Test environment S3 bucket (for RPMs)
17+
TEST_S3_BUCKET="distribution-test"
18+
TEST_S3_ENDPOINT="object.storage.eu01.onstackit.cloud"
19+
TEST_RPM_REPO_PATH="rpm/cli"
20+
21+
# Production S3 bucket (for GPG key)
22+
PROD_S3_BUCKET="distribution"
23+
PROD_S3_ENDPOINT="object.storage.eu01.onstackit.cloud"
24+
PROD_GPG_KEY_PATH="keys/key.gpg"
25+
26+
echo "Step 1: Starting Fedora container..."
27+
docker run -d --name $CONTAINER_NAME $IMAGE tail -f /dev/null
28+
29+
echo "Step 2: Installing dependencies..."
30+
docker exec $CONTAINER_NAME bash -c "
31+
dnf update -y
32+
dnf install -y curl wget gpg
33+
"
34+
35+
echo "Step 3: Downloading GPG key from production bucket..."
36+
docker exec $CONTAINER_NAME bash -c "
37+
curl -o /tmp/stackit-gpg-signer.asc 'https://$PROD_S3_BUCKET.$PROD_S3_ENDPOINT/$PROD_GPG_KEY_PATH'
38+
gpg --import /tmp/stackit-gpg-signer.asc
39+
echo '✅ GPG key imported'
40+
"
41+
42+
echo "Step 4: Creating repository configuration..."
43+
docker exec $CONTAINER_NAME bash -c "
44+
cat > /etc/yum.repos.d/stackit-cli.repo << EOF
45+
[stackit-cli]
46+
name=STACKIT CLI Repository
47+
baseurl=https://$TEST_S3_BUCKET.$TEST_S3_ENDPOINT/$TEST_RPM_REPO_PATH
48+
enabled=1
49+
gpgcheck=1
50+
repo_gpgcheck=1
51+
gpgkey=https://$PROD_S3_BUCKET.$PROD_S3_ENDPOINT/$PROD_GPG_KEY_PATH
52+
EOF
53+
cat /etc/yum.repos.d/stackit-cli.repo
54+
echo '✅ Repository configuration created'
55+
"
56+
57+
echo "Step 5: Updating package cache..."
58+
docker exec $CONTAINER_NAME bash -c "
59+
dnf clean all
60+
dnf repolist
61+
echo '✅ Package cache updated'
62+
"
63+
64+
echo "Step 6: Installing STACKIT CLI..."
65+
docker exec $CONTAINER_NAME bash -c "
66+
dnf install -y stackit
67+
echo '✅ STACKIT CLI installed'
68+
"
69+
70+
echo "Step 7: Verifying installation..."
71+
docker exec $CONTAINER_NAME bash -c "
72+
if command -v stackit >/dev/null 2>&1; then
73+
echo '✅ stackit command found: \$(which stackit)'
74+
echo '✅ Version: \$(stackit version)'
75+
else
76+
echo '❌ stackit command not found'
77+
exit 1
78+
fi
79+
"
80+
81+
echo "Step 8: Testing basic functionality..."
82+
docker exec $CONTAINER_NAME bash -c "
83+
echo '=== STACKIT CLI HELP OUTPUT ==='
84+
stackit --help
85+
echo '=== END HELP OUTPUT ==='
86+
echo '✅ Basic functionality test passed'
87+
"
88+
89+
echo "Step 9: Testing package update..."
90+
docker exec $CONTAINER_NAME bash -c "
91+
dnf check-update stackit || echo 'No updates available (expected for test)'
92+
echo '✅ Update check completed'
93+
"
94+
95+
echo "Step 10: Uninstalling STACKIT CLI..."
96+
docker exec $CONTAINER_NAME bash -c "
97+
dnf remove -y stackit
98+
echo '✅ STACKIT CLI uninstalled'
99+
"
100+
101+
echo "Step 11: Verifying uninstallation..."
102+
docker exec $CONTAINER_NAME bash -c "
103+
if ! command -v stackit >/dev/null 2>&1; then
104+
echo '✅ stackit command no longer found'
105+
else
106+
echo '❌ stackit command still found: \$(which stackit)'
107+
exit 1
108+
fi
109+
"
110+
111+
echo "Step 12: Cleaning up container..."
112+
docker stop $CONTAINER_NAME
113+
docker rm $CONTAINER_NAME
114+
115+
echo "=========================================="
116+
echo "✅ Fedora RPM test completed successfully!"
117+
echo "=========================================="

0 commit comments

Comments
 (0)