Files
godot-builder-image/build.sh
Olof Pettersson 6a58136009
Some checks failed
Publish Builder Images / build-and-push (push) Failing after 1m32s
Try new build container toolchain
2025-12-02 10:11:21 +01:00

69 lines
2.2 KiB
Bash

#!/bin/sh
set -e # Stop on any error
# --- Configuration ---
# 1. Image Names for your Registry
BASE_IMAGE_NAME="godot-builder-base"
WIN_IMAGE_NAME="godot-builder-windows"
# 2. Construct full registry paths
# Uses variables passed from the workflow env: $REGISTRY, $USERNAME, $TAG
FULL_BASE_TAG="$REGISTRY/$USERNAME/$BASE_IMAGE_NAME:$TAG"
LATEST_BASE_TAG="$REGISTRY/$USERNAME/$BASE_IMAGE_NAME:latest"
FULL_WIN_TAG="$REGISTRY/$USERNAME/$WIN_IMAGE_NAME:$TAG"
LATEST_WIN_TAG="$REGISTRY/$USERNAME/$WIN_IMAGE_NAME:latest"
# 3. Login
echo "Logging in to $REGISTRY..."
buildah login -u "$USERNAME" -p "$PASSWORD" --tls-verify=false --storage-driver=vfs "$REGISTRY"
# --- STEP 1: Build Base Image ---
echo "---------------------------------------"
echo "Building BASE image (Fedora)..."
echo "---------------------------------------"
# Build and tag for the registry
buildah build \
--tls-verify=false \
--storage-driver=vfs \
-f Dockerfile.base \
-t "$FULL_BASE_TAG" \
-t "$LATEST_BASE_TAG" \
.
# CRITICAL STEP: Create the local alias
# The Windows Dockerfile expects "FROM godot-fedora:custom"
# So we tag our just-built image to match that expectation.
buildah tag "$FULL_BASE_TAG" "godot-fedora:custom"
# Push Base to registry (Checkpoint)
echo "Pushing Base image..."
buildah push --tls-verify=false --storage-driver=vfs "$FULL_BASE_TAG"
buildah push --tls-verify=false --storage-driver=vfs "$LATEST_BASE_TAG"
# --- STEP 2: Build Windows Image ---
echo "---------------------------------------"
echo "Building WINDOWS image..."
echo "---------------------------------------"
# We pass 'img_version=custom' to match the tag we just created.
buildah build \
--tls-verify=false \
--storage-driver=vfs \
--build-arg img_version=custom \
-f Dockerfile.windows \
-t "$FULL_WIN_TAG" \
-t "$LATEST_WIN_TAG" \
.
# Push Windows Image
echo "Pushing Windows image..."
buildah push --tls-verify=false --storage-driver=vfs "$FULL_WIN_TAG"
buildah push --tls-verify=false --storage-driver=vfs "$LATEST_WIN_TAG"
echo "---------------------------------------"
echo "SUCCESS!"
echo "Base Image: $FULL_BASE_TAG"
echo "Windows Image: $FULL_WIN_TAG"
echo "---------------------------------------"