Skip to content

Commit 50b8108

Browse files
committed
refactor(build): Replace build tooling with simplified script-based approach
Replace the build toolchain with a cleaner, script-based approach using just as the task runner: - hack/build.sh: Unified multi-version build + publish script - hack/generate-image-manifests.sh: OpenStack Image CRD generator - hack/generate-resources.sh: ClusterStack + Cluster YAML generator - hack/show-matrix.sh: Version matrix display tool - hack/update-addons.sh: Generic addon updater with versions.yaml sync - hack/docugen.py: Rewritten to accept any stack directory as argument - justfile: Just task runner (replaces Taskfile.yml) - Containerfile: Alpine 3.21, pinned tool versions - flake.nix: Updated dev shell (just instead of task, dropped py3-requests) Assisted-by: Claude Code Signed-off-by: Jan Schoone <jan.schoone@uhurutec.com>
1 parent 828710f commit 50b8108

16 files changed

Lines changed: 1518 additions & 837 deletions

Containerfile

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
FROM alpine:3.21
2+
3+
LABEL org.opencontainers.image.source="https://github.com/SovereignCloudStack/cluster-stacks"
4+
LABEL org.opencontainers.image.description="Cluster Stack Build Tools"
5+
LABEL org.opencontainers.image.licenses="Apache-2.0"
6+
7+
# Install system dependencies
8+
RUN apk add --no-cache \
9+
bash \
10+
git \
11+
curl \
12+
tar \
13+
gzip \
14+
gawk \
15+
python3 \
16+
py3-yaml \
17+
jq \
18+
ca-certificates
19+
20+
# Install helm
21+
RUN HELM_VERSION=v3.17.3 && \
22+
curl -fsSL "https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz" | \
23+
tar -xz -C /usr/local/bin --strip-components=1 linux-amd64/helm
24+
25+
# Install yq (mikefarah)
26+
RUN YQ_VERSION=v4.45.4 && \
27+
curl -fsSL "https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64" \
28+
-o /usr/local/bin/yq && chmod +x /usr/local/bin/yq
29+
30+
# Install oras
31+
RUN ORAS_VERSION=1.2.2 && \
32+
curl -fsSL "https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_linux_amd64.tar.gz" | \
33+
tar -xz -C /usr/local/bin oras
34+
35+
# Install just
36+
RUN JUST_VERSION=1.40.0 && \
37+
curl -fsSL "https://github.com/casey/just/releases/download/${JUST_VERSION}/just-${JUST_VERSION}-x86_64-unknown-linux-musl.tar.gz" | \
38+
tar -xz -C /usr/local/bin just
39+
40+
WORKDIR /workspace
41+
42+
# Verify installations
43+
RUN bash --version | head -1 && \
44+
helm version --short && \
45+
yq --version && \
46+
oras version && \
47+
just --version && \
48+
git --version
49+
50+
# Allow git operations inside mounted volumes
51+
RUN git config --global --add safe.directory /workspace
52+
53+
CMD ["/bin/bash"]

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
description = "Cluster Stacks - Build tools for SCS Kubernetes cluster stacks";
3+
4+
inputs = {
5+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
6+
flake-utils.url = "github:numtide/flake-utils";
7+
};
8+
9+
outputs = { self, nixpkgs, flake-utils }:
10+
flake-utils.lib.eachDefaultSystem (system:
11+
let
12+
pkgs = nixpkgs.legacyPackages.${system};
13+
in
14+
{
15+
devShells.default = pkgs.mkShell {
16+
name = "cluster-stacks-dev";
17+
18+
buildInputs = with pkgs; [
19+
# Core tools
20+
bash
21+
git
22+
curl
23+
24+
# Container tools
25+
docker
26+
podman
27+
28+
# Kubernetes tools
29+
kubectl
30+
kubernetes-helm
31+
kind
32+
kustomize
33+
34+
# Build tools
35+
just
36+
python3
37+
python3Packages.pyyaml
38+
jq
39+
yq-go
40+
41+
# OCI/Registry tools
42+
oras
43+
];
44+
45+
shellHook = ''
46+
echo "Cluster Stacks development environment"
47+
echo ""
48+
echo "Available tools:"
49+
echo " just - Run 'just --list' to see available commands"
50+
echo " helm - Kubernetes package manager"
51+
echo " kubectl - Kubernetes CLI"
52+
echo " kind - Local Kubernetes clusters"
53+
echo " yq - YAML processor"
54+
echo " oras - OCI registry client"
55+
echo " python3 - With PyYAML"
56+
echo ""
57+
58+
# Source .env if it exists
59+
if [ -f .env ]; then
60+
set -a
61+
source .env
62+
set +a
63+
echo "Loaded .env"
64+
elif [ -f task.env ]; then
65+
set -a
66+
source task.env
67+
set +a
68+
echo "Loaded task.env"
69+
else
70+
echo "No .env or task.env found. Copy task.env.example to get started."
71+
fi
72+
'';
73+
};
74+
}
75+
);
76+
}

0 commit comments

Comments
 (0)