Skip to content

Commit c4e66c3

Browse files
authored
refactor: Use install scripts (#80)
1 parent 6733e5a commit c4e66c3

File tree

13 files changed

+148
-122
lines changed

13 files changed

+148
-122
lines changed

.scripts/actions/install_boil.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
[ -n "$GITHUB_DEBUG" ] && set -x
5+
6+
ARCH=$(uname -m)
7+
8+
if [ "$BOIL_VERSION" == "latest" ]; then
9+
curl -fsSL -o /tmp/boil "https://github.com/stackabletech/docker-images/releases/latest/download/boil-${ARCH}-unknown-linux-gnu"
10+
else
11+
curl -fsSL -o /tmp/boil "https://github.com/stackabletech/docker-images/releases/download/boil-${BOIL_VERSION}/boil-${ARCH}-unknown-linux-gnu"
12+
fi
13+
14+
sudo install -m 755 -t /usr/local/bin /tmp/boil

.scripts/actions/install_helm.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
[ -n "$GITHUB_DEBUG" ] && set -x
5+
6+
PLATFORM=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_platform.sh")
7+
ARCH=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_architecture.sh")
8+
9+
FILENAME="helm-${HELM_VERSION}-${PLATFORM}-${ARCH}.tar.gz"
10+
11+
echo "::group::Install helm"
12+
mkdir /tmp/helm
13+
curl -fsSL -o /tmp/helm/helm.tar.gz "https://get.helm.sh/${FILENAME}"
14+
curl -fsSL -o /tmp/helm/helm.tar.gz.asc "https://github.com/helm/helm/releases/download/${HELM_VERSION}/${FILENAME}.asc"
15+
16+
curl https://keybase.io/mattfarina/pgp_keys.asc | gpg --import
17+
gpg --verify /tmp/helm/helm.tar.gz.asc /tmp/helm/helm.tar.gz
18+
19+
tar --directory="/tmp/helm" --strip-components=1 -zxvf /tmp/helm/helm.tar.gz "${PLATFORM}-${ARCH}"
20+
# Overwrite the existing binary
21+
sudo install -m 755 -t /usr/local/bin /tmp/helm/helm
22+
23+
helm version --short
24+
echo "::endgroup::"

.scripts/actions/install_interu.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
[ -n "$GITHUB_DEBUG" ] && set -x
5+
6+
ARCH=$(uname -m)
7+
8+
if [ "$INTERU_VERSION" == "latest" ]; then
9+
curl -fsSL -o /tmp/interu "https://github.com/stackabletech/actions/releases/latest/download/interu-${ARCH}-unknown-linux-gnu"
10+
else
11+
curl -fsSL -o /tmp/interu "https://github.com/stackabletech/actions/releases/download/interu-${INTERU_VERSION}/interu-${ARCH}-unknown-linux-gnu"
12+
fi
13+
14+
sudo install -m 755 -t /usr/local/bin /tmp/interu
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
[ -n "$GITHUB_DEBUG" ] && set -x
5+
6+
ARCH=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_architecture.sh")
7+
8+
echo "::group::Install kubectl"
9+
curl -fsSL -o /tmp/kubectl "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl"
10+
# Overwrite the existing binary
11+
sudo install -m 755 -t /usr/local/bin /tmp/kubectl
12+
13+
kubectl version --client
14+
echo "::endgroup::"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
[ -n "$GITHUB_DEBUG" ] && set -x
5+
6+
ARCH=$(uname -m)
7+
8+
echo "::group::Install kubectl-kuttl"
9+
curl -fsSL -o /tmp/kubectl-kuttl "https://github.com/kudobuilder/kuttl/releases/download/v$KUTTL_VERSION/kubectl-kuttl_${KUTTL_VERSION}_linux_${ARCH}"
10+
sudo install -m 755 -t /usr/local/bin /tmp/kubectl-kuttl
11+
echo "::endgroup::"
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
[ -n "$GITHUB_DEBUG" ] && set -x
5+
6+
ARCH=$(uname -m)
7+
8+
if [ "$STACKABLECTL_VERSION" == "latest" ]; then
9+
curl -fsSL -o /tmp/stackablectl "https://github.com/stackabletech/stackable-cockpit/releases/latest/download/stackablectl-${ARCH}-unknown-linux-gnu"
10+
else
11+
curl -fsSL -o /tmp/stackablectl "https://github.com/stackabletech/stackable-cockpit/releases/download/stackablectl-${STACKABLECTL_VERSION}/stackablectl-${ARCH}-unknown-linux-gnu"
12+
fi
13+
14+
sudo install -m 755 -t /usr/local/bin /tmp/stackablectl

RELEASE.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,5 @@
33
To release a new set of actions follow these steps:
44

55
- Choose an appropriate new semantic version based on the latest changes
6-
- Update any references in actions to other local actions to the chosen version
7-
- Raise a PR with the appropriate changes
8-
- Once merged, tag on `main` using `git tag -s v<X.Y.Z>`
6+
- Add a tag on `main` using `git tag -s v<X.Y.Z>`
97
- Manually create a GitHub release

build-product-image/action.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ runs:
4242
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
4343

4444
- name: Setup boil (${{ inputs.boil-version }})
45-
# Using other "local" actions is super painful. As such, a follow-up PR will make this way
46-
# more comfortable again.
47-
uses: stackabletech/actions/setup-tools@main # TODO: Replace with latest released version
48-
with:
49-
boil-version: ${{ inputs.boil-version }}
45+
env:
46+
BOIL_VERSION: ${{ inputs.boil-version }}
47+
GITHUB_DEBUG: ${{ runner.debug }}
48+
shell: bash
49+
run: "$GITHUB_ACTION_PATH/../.scripts/actions/install_boil.sh"
5050

5151
- name: Building ${{ inputs.product-name }} Container Image using boil
5252
env:

publish-helm-chart/action.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@ runs:
3434
uses: sigstore/cosign-installer@398d4b0eeef1380460a10c8013a76f728fb906ac # v3.9.1
3535

3636
- name: Set up Helm
37-
# We cannot use a path to point to the local action
38-
# See https://github.com/orgs/community/discussions/74934
39-
# Using other "local" actions is super painful. As such, a follow-up PR will make this way
40-
# more comfortable again.
41-
uses: stackabletech/actions/setup-k8s-tools@main # TODO: Replace with latest released version
42-
with:
43-
helm-version: ${{ inputs.helm-version }}
37+
env:
38+
HELM_VERSION: ${{ inputs.helm-version }}
39+
GITHUB_DEBUG: ${{ runner.debug }}
40+
shell: bash
41+
run: "$GITHUB_ACTION_PATH/../.scripts/actions/install_helm.sh"
4442

4543
- name: Log into Container Registry (${{ inputs.chart-registry-uri }}) using Helm
4644
env:

run-integration-test/action.yaml

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,12 @@ runs:
6060
using: composite
6161
steps:
6262
- name: Install interu
63-
# Using other "local" actions is super painful. As such, a follow-up PR will make this way
64-
# more comfortable again.
65-
uses: stackabletech/actions/setup-tools@main # TODO: Replace with latest released version
66-
with:
67-
interu-version: ${{ inputs.interu-version }}
63+
env:
64+
INTERU_VERSION: ${{ inputs.interu-version }}
65+
GITHUB_DEBUG: ${{ runner.debug }}
66+
shell: bash
67+
run: "$GITHUB_ACTION_PATH/../.scripts/actions/install_interu.sh"
68+
6869
- name: Extract Test and Instance Configuration
6970
env:
7071
TEST_MODE_INPUT: ${{ inputs.test-mode-input }}
@@ -99,27 +100,41 @@ runs:
99100
# and are therefore not available, there is no need to create the cluster or run the tests,
100101
# because the tests can never run in the first place.
101102
- name: Install kubectl, kubectl-kuttl, and helm
102-
# Using other "local" actions is super painful. As such, a follow-up PR will make this way
103-
# more comfortable again.
104-
uses: stackablectl/actions/setup-k8s-tools@main # TODO: Replace with latest released version
105-
with:
106-
kubectl-version: ${{ inputs.kubectl-version }}
107-
kuttl-version: ${{ inputs.kuttl-version }}
108-
helm-version: ${{ inputs.helm-version }}
103+
env:
104+
KUBECTL_VERSION: ${{ inputs.kubectl-version }}
105+
KUTTL_VERSION: ${{ inputs.kuttl-version }}
106+
HELM_VERSION: ${{ inputs.helm-version }}
107+
GITHUB_DEBUG: ${{ runner.debug }}
108+
shell: bash
109+
run: |
110+
"$GITHUB_ACTION_PATH/../.scripts/actions/install_kubectl.sh"
111+
"$GITHUB_ACTION_PATH/../.scripts/actions/install_kubectl_kuttl.sh"
112+
"$GITHUB_ACTION_PATH/../.scripts/actions/install_helm.sh"
109113
110114
# Python3 is already installed, if we ever need to specify the version, we can use the
111115
# setup-python action.
112116
# See https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/install-python.sh
113117
#
114118
# mikefarah/yq is already installed on the runner
115119
# See https://github.com/actions/runner-images/blob/main/images/ubuntu/scripts/build/install-yq.sh
116-
- name: Install stackablectl and beku
117-
# Using other "local" actions is super painful. As such, a follow-up PR will make this way
118-
# more comfortable again.
119-
uses: stackabletech/actions/setup-tools@main # TODO: Replace with latest released version
120-
with:
121-
stackablectl-version: ${{ inputs.stackablectl-version }}
122-
beku-version: ${{ inputs.beku-version }}
120+
- name: Install stackablectl
121+
env:
122+
STACKABLECTL_VERSION: ${{ inputs.stackablectl-version }}
123+
BEKU_VERSION: ${{ inputs.beku-version }}
124+
GITHUB_DEBUG: ${{ runner.debug }}
125+
shell: bash
126+
run: "$GITHUB_ACTION_PATH/../.scripts/actions/install_stackablectl.sh"
127+
128+
- name: Install beku
129+
env:
130+
BEKU_VERSION: ${{ inputs.beku-version }}
131+
GITHUB_DEBUG: ${{ runner.debug }}
132+
shell: bash
133+
run: |
134+
set -euo pipefail
135+
[ -n "$GITHUB_DEBUG" ] && set -x
136+
137+
pip install "beku-stackabletech==$BEKU_VERSION"
123138
124139
- name: Install apt packages
125140
shell: bash

0 commit comments

Comments
 (0)