Setup: utente admin via web, ruoli e run-context con security-group, onboarding install/uninstall script
Nightly Build / build (push) Failing after 6m12s

This commit is contained in:
2026-07-20 12:54:56 +01:00
parent b6128e4053
commit 44dc67cda0
29 changed files with 1631 additions and 110 deletions
+51 -24
View File
@@ -2,21 +2,22 @@
# Package a Skald Circle build into a distributable tarball.
#
# Usage:
# ./scripts/package.sh \
# ./ci/package.sh \
# --version v0.1.0 \
# --os linux \
# --arch amd64 \
# --target-dir target/release \
# --output /tmp/dist
#
# --version Version string, e.g. "v0.1.0" or "nightly"
# --arch Architecture: "amd64" or "arm64"
# --target-dir Path to cargo release output (target/release or
# target/aarch64-unknown-linux-gnu/release)
# --output Directory where the .tar.gz will be written
# --version Version string, e.g. "v0.1.0" or "nightly"
# --os Target OS: "linux" or "darwin"
# --arch Architecture: "amd64" or "arm64"
# --target-dir Path to cargo release output
# --output Directory where the .tar.gz will be written
#
# The tarball contains everything needed to run Skald Circle:
# The tarball contains everything needed to run (or uninstall) Skald Circle:
# bin/skald, bin/skald-setup, web/, agents/, skills/,
# default.config.yaml, requirements.txt, run.sh
# default.config.yaml, requirements.txt, run.sh, uninstall.sh
set -eu
@@ -24,6 +25,7 @@ cd "$(dirname "$0")/.."
# ── Parse args ────────────────────────────────────────────────────────────────
VERSION=""
OS=""
ARCH=""
TARGET_DIR=""
OUTPUT=""
@@ -31,6 +33,7 @@ OUTPUT=""
while [ $# -gt 0 ]; do
case "$1" in
--version) VERSION="$2"; shift 2 ;;
--os) OS="$2"; shift 2 ;;
--arch) ARCH="$2"; shift 2 ;;
--target-dir) TARGET_DIR="$2"; shift 2 ;;
--output) OUTPUT="$2"; shift 2 ;;
@@ -38,18 +41,23 @@ while [ $# -gt 0 ]; do
esac
done
if [ -z "$VERSION" ] || [ -z "$ARCH" ] || [ -z "$TARGET_DIR" ] || [ -z "$OUTPUT" ]; then
if [ -z "$VERSION" ] || [ -z "$OS" ] || [ -z "$ARCH" ] || [ -z "$TARGET_DIR" ] || [ -z "$OUTPUT" ]; then
echo "[package.sh] Missing required argument. See usage." >&2
exit 1
fi
PACKAGE_NAME="skald-circle-${VERSION}-linux-${ARCH}"
case "$OS" in
linux|darwin) ;;
*) echo "[package.sh] Unsupported OS: $OS (use linux or darwin)" >&2; exit 1 ;;
esac
PACKAGE_NAME="skald-circle-${VERSION}-${OS}-${ARCH}"
STAGING="$(mktemp -d)/${PACKAGE_NAME}"
mkdir -p "$STAGING/bin"
echo "[package.sh] Packaging $PACKAGE_NAME"
echo "[package.sh] target-dir: $TARGET_DIR"
echo "[package.sh] output: $OUTPUT"
echo "[package.sh] target-dir: $TARGET_DIR"
echo "[package.sh] output: $OUTPUT"
# ── Verify binaries exist ─────────────────────────────────────────────────────
if [ ! -f "$TARGET_DIR/skald" ]; then
@@ -61,15 +69,23 @@ if [ ! -f "$TARGET_DIR/skald-setup" ]; then
exit 1
fi
# ── Copy binaries (stripped) ──────────────────────────────────────────────────
if [ "$ARCH" = "arm64" ]; then
STRIP="aarch64-linux-gnu-strip"
else
STRIP="strip"
fi
# ── Copy binaries (stripped, best-effort on darwin) ───────────────────────────
cp "$TARGET_DIR/skald" "$STAGING/bin/skald"
cp "$TARGET_DIR/skald-setup" "$STAGING/bin/skald-setup"
$STRIP "$STAGING/bin/skald" "$STAGING/bin/skald-setup"
if [ "$OS" = "darwin" ]; then
# On macOS: strip via xcrun or the system strip (skip if cross-compiled)
if command -v xcrun >/dev/null 2>&1; then
xcrun strip "$STAGING/bin/skald" "$STAGING/bin/skald-setup" 2>/dev/null || true
elif command -v strip >/dev/null 2>&1; then
strip "$STAGING/bin/skald" "$STAGING/bin/skald-setup" 2>/dev/null || true
fi
elif [ "$ARCH" = "arm64" ]; then
STRIP="aarch64-linux-gnu-strip"
$STRIP "$STAGING/bin/skald" "$STAGING/bin/skald-setup"
else
strip "$STAGING/bin/skald" "$STAGING/bin/skald-setup"
fi
chmod 755 "$STAGING/bin/skald" "$STAGING/bin/skald-setup"
# ── Copy runtime assets ───────────────────────────────────────────────────────
@@ -79,7 +95,8 @@ cp -r skills "$STAGING/skills"
cp default.config.yaml "$STAGING/default.config.yaml"
cp requirements.txt "$STAGING/requirements.txt"
cp run.sh "$STAGING/run.sh"
chmod 755 "$STAGING/run.sh"
cp uninstall.sh "$STAGING/uninstall.sh"
chmod 755 "$STAGING/run.sh" "$STAGING/uninstall.sh"
# ── Create tarball ────────────────────────────────────────────────────────────
mkdir -p "$OUTPUT"
@@ -91,7 +108,17 @@ cd - > /dev/null
rm -rf "$(dirname "$STAGING")"
SHA256="$(sha256sum "$TARBALL" | cut -d' ' -f1)"
echo "[package.sh] ✅ Created $TARBALL"
echo "[package.sh] sha256: $SHA256"
echo "[package.sh] size: $(du -h "$TARBALL" | cut -f1)"
if command -v sha256sum >/dev/null 2>&1; then
SHA256="$(sha256sum "$TARBALL" | cut -d' ' -f1)"
echo "[package.sh] ✅ Created $TARBALL"
echo "[package.sh] sha256: $SHA256"
echo "[package.sh] size: $(du -h "$TARBALL" | cut -f1)"
elif command -v shasum >/dev/null 2>&1; then
SHA256="$(shasum -a 256 "$TARBALL" | cut -d' ' -f1)"
echo "[package.sh] ✅ Created $TARBALL"
echo "[package.sh] sha256: $SHA256"
echo "[package.sh] size: $(du -h "$TARBALL" | cut -f1)"
else
echo "[package.sh] ✅ Created $TARBALL"
echo "[package.sh] size: $(du -h "$TARBALL" | cut -f1)"
fi