fix: Enable privileged mode for ISO build

This commit is contained in:
MrPiglr 2025-12-28 09:06:39 -07:00
parent 06f86ffa9c
commit 069b9d052d

View file

@ -1,82 +1,86 @@
stages: stages:
- build - build
- release - release
build_iso: build_iso:
stage: build stage: build
image: ubuntu:24.04 image: ubuntu:24.04
timeout: 90 minutes timeout: 90 minutes
rules: tags:
- if: '$CI_COMMIT_BRANCH == "main"' - docker
- if: '$CI_COMMIT_TAG' variables:
artifacts: DOCKER_PRIVILEGED: "true"
paths: rules:
- aethex-linux-build/ - if: '$CI_COMMIT_BRANCH == "main"'
- artifacts/local/ - if: '$CI_COMMIT_TAG'
expire_in: 90 days artifacts:
script: paths:
# Update system - aethex-linux-build/
- apt-get update -qq - artifacts/local/
- apt-get install -y -qq build-essential curl wget git nodejs npm debootstrap squashfs-tools xorriso grub-common grub-pc-bin grub-efi-amd64-bin mtools dosfstools isolinux syslinux-common expire_in: 90 days
script:
# Verify critical tools are installed # Update system
- which mksquashfs && echo "✅ mksquashfs found" || (echo "❌ mksquashfs missing" && exit 1) - apt-get update -qq
- which grub-mkrescue && echo "✅ grub-mkrescue found" || (echo "❌ grub-mkrescue missing" && exit 1) - apt-get install -y -qq build-essential curl wget git nodejs npm debootstrap squashfs-tools xorriso grub-common grub-pc-bin grub-efi-amd64-bin mtools dosfstools isolinux syslinux-common
- which debootstrap && echo "✅ debootstrap found" || (echo "❌ debootstrap missing" && exit 1)
# Verify critical tools are installed
# Install Node dependencies - which mksquashfs && echo "✅ mksquashfs found" || (echo "❌ mksquashfs missing" && exit 1)
- npm install - which grub-mkrescue && echo "✅ grub-mkrescue found" || (echo "❌ grub-mkrescue missing" && exit 1)
- which debootstrap && echo "✅ debootstrap found" || (echo "❌ debootstrap missing" && exit 1)
# Build client
- npm run build # Install Node dependencies
- npm install
# Build ISO (fail if it errors)
- mkdir -p aethex-linux-build # Build client
- bash script/build-linux-iso.sh - npm run build
# Verify ISO exists (fail the build if not) # Build ISO (fail if it errors)
- | - mkdir -p aethex-linux-build
ISO_PATH=$(ls aethex-linux-build/AeThex-Linux-*.iso 2>/dev/null | head -n 1) - bash script/build-linux-iso.sh
if [ -n "$ISO_PATH" ]; then
echo "✅ ISO built successfully: $ISO_PATH" # Verify ISO exists (fail the build if not)
ls -lh "$ISO_PATH" - |
sha256sum "$ISO_PATH" > aethex-linux-build/SHA256 ISO_PATH=$(ls aethex-linux-build/AeThex-Linux-*.iso 2>/dev/null | head -n 1)
mkdir -p artifacts/local if [ -n "$ISO_PATH" ]; then
cp "$ISO_PATH" artifacts/local/ echo "✅ ISO built successfully: $ISO_PATH"
cp aethex-linux-build/SHA256 artifacts/local/$(basename "$ISO_PATH").sha256 ls -lh "$ISO_PATH"
else sha256sum "$ISO_PATH" > aethex-linux-build/SHA256
echo "❌ ISO not found! Build failed." mkdir -p artifacts/local
ls -la aethex-linux-build/ || echo "Build directory doesn't exist" cp "$ISO_PATH" artifacts/local/
exit 1 cp aethex-linux-build/SHA256 artifacts/local/$(basename "$ISO_PATH").sha256
fi else
echo "❌ ISO not found! Build failed."
release_iso: ls -la aethex-linux-build/ || echo "Build directory doesn't exist"
stage: release exit 1
image: registry.gitlab.com/gitlab-org/release-cli:latest fi
needs:
- job: build_iso release_iso:
artifacts: true stage: release
rules: image: registry.gitlab.com/gitlab-org/release-cli:latest
- if: '$CI_COMMIT_TAG' needs:
variables: - job: build_iso
RELEASE_NAME: "AeThex OS $CI_COMMIT_TAG" artifacts: true
script: rules:
- echo "Creating GitLab release for tag $CI_COMMIT_TAG" - if: '$CI_COMMIT_TAG'
- | variables:
ISO_PATH=$(ls artifacts/local/AeThex-Linux-*.iso 2>/dev/null | head -n 1) RELEASE_NAME: "AeThex OS $CI_COMMIT_TAG"
if [ -z "$ISO_PATH" ]; then script:
echo "No ISO found in artifacts/local. Listing..." && ls -la artifacts/local || true - echo "Creating GitLab release for tag $CI_COMMIT_TAG"
fi - |
- | ISO_PATH=$(ls artifacts/local/AeThex-Linux-*.iso 2>/dev/null | head -n 1)
if [ -n "$ISO_PATH" ]; then if [ -z "$ISO_PATH" ]; then
# Create release and attach asset link pointing to job artifact (90-day retention) echo "No ISO found in artifacts/local. Listing..." && ls -la artifacts/local || true
release-cli create \ fi
--name "$RELEASE_NAME" \ - |
--tag-name "$CI_COMMIT_TAG" \ if [ -n "$ISO_PATH" ]; then
--assets-link name="AeThex OS ISO" url="$CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/file/$ISO_PATH" # Create release and attach asset link pointing to job artifact (90-day retention)
else release-cli create \
# Create release without asset if ISO missing --name "$RELEASE_NAME" \
release-cli create \ --tag-name "$CI_COMMIT_TAG" \
--name "$RELEASE_NAME" \ --assets-link name="AeThex OS ISO" url="$CI_PROJECT_URL/-/jobs/$CI_JOB_ID/artifacts/file/$ISO_PATH"
--tag-name "$CI_COMMIT_TAG" else
fi # Create release without asset if ISO missing
release-cli create \
--name "$RELEASE_NAME" \
--tag-name "$CI_COMMIT_TAG"
fi