ci: parallelize opt-in main amd64 builds [CI]

Merge PR #11. Build Backend, Agent, and Probe concurrently on main.
This commit is contained in:
justme committed 2026-10-06 08:04:13 +00:00
commit da0a0e3443
2 files changed
+41 -21

No files matched your search

+18 -2
View File
@@ -16,10 +16,26 @@ when:
concurrency: 1
steps:
- name: build-linux-amd64-images
- name: build-linux-amd64-backend
image: bash
environment:
NUGET_PACKAGES: /home/justme/.nuget/packages
commands:
- bash ci/build-main-amd64.sh
- bash ci/build-main-amd64.sh backend
depends_on: []
- name: build-linux-amd64-agent
image: bash
environment:
NUGET_PACKAGES: /home/justme/.nuget/packages
commands:
- bash ci/build-main-amd64.sh agent
depends_on: []
- name: build-linux-amd64-probe
image: bash
environment:
NUGET_PACKAGES: /home/justme/.nuget/packages
commands:
- bash ci/build-main-amd64.sh probe
depends_on: []
+23 -19
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Build all main Linux amd64 runtime images locally when a commit opts into CI.
# Build one Linux amd64 runtime image locally for an opt-in main commit.
set -euo pipefail
[[ "${CI_PIPELINE_EVENT:-}" == push && "${CI_COMMIT_BRANCH:-}" == main && "${CI_COMMIT_MESSAGE:-}" == *"[CI]"* ]] || {
@@ -7,26 +7,30 @@ set -euo pipefail
exit 2
}
component="${1:?usage: build-main-amd64.sh <backend|agent|probe>}"
case "$component" in
backend|agent|probe) ;;
*) echo "unsupported component: $component" >&2; exit 2 ;;
esac
root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
work="$root/.release/main-amd64-build"
base_home="/home/justme/woodpecker/buildah-home/main-amd64-build"
mkdir -p "$work"
export IMAGE_PUBLISH=false
base_home="/home/justme/woodpecker/buildah-home/main-amd64-build-$component"
mkdir -p "$work" "$base_home"
BUILDAH_HOME="$base_home-backend" IMAGE_PUBLISH=false bash "$root/ci/release-linux.sh" amd64 backend
if [[ "$component" == backend ]]; then
BUILDAH_HOME="$base_home" IMAGE_PUBLISH=false bash "$root/ci/release-linux.sh" amd64 backend
exit 0
fi
for component in agent probe; do
context="$work/$component"
home="$base_home-$component"
mkdir -p "$home"
export HOME="$home"
export BUILDAH_HOME="$home"
export REGISTRY_AUTH_FILE="$work/$component-auth.json"
export HOME="$base_home"
export BUILDAH_HOME="$base_home"
export REGISTRY_AUTH_FILE="$work/$component-auth.json"
context="$work/$component"
python3 "$root/ci/stage-node-image.py" "$component" "$context"
buildah bud --layers --network host --tls-verify=true --arch amd64 \
--build-arg APP_VERSION=main \
-f "$context/Containerfile" \
-t "localhost/monitor-$component:main-amd64-check" "$context"
echo "built local Linux amd64 $component image; not publishing it"
done
python3 "$root/ci/stage-node-image.py" "$component" "$context"
buildah bud --layers --network host --tls-verify=true --arch amd64 \
--build-arg APP_VERSION=main \
-f "$context/Containerfile" \
-t "localhost/monitor-$component:main-amd64-check" "$context"
echo "built local Linux amd64 $component image; not publishing it"