ci: restore external package integration
This commit is contained in:
+26
-26
@@ -1,46 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
# Signage inside Ekklesia, end to end: builds the deployment image from the assembled workspace with
|
||||
# the platform's own Dockerfile, then runs the platform's split-topology deployment smoke against it
|
||||
# with the display-device scenarios listed in ci/display-scenarios. A disposable PostgreSQL and object
|
||||
# store, generated secrets, and an explicit migration apply against that fresh database only; nothing
|
||||
# is pushed, published, or logged in to. The image is removed afterwards.
|
||||
# Builds Signage as the canonical linux-x64-glibc Module Package, then gives that exact release pair
|
||||
# to the pinned platform's generic deployment smoke. The platform image contains no Signage source:
|
||||
# its verifier extracts the package into installation-owned module storage before migrations,
|
||||
# discovery, browser UI/display checks, restart, container recreation, disable/re-enable, removal,
|
||||
# and reinstall are exercised against disposable PostgreSQL and object-storage services.
|
||||
#
|
||||
# bash ci/fetch-platform.sh
|
||||
# bash ci/integration.sh
|
||||
#
|
||||
# NOT RUN: the integration job is disabled (.gitea/workflows/ci.yml says why). This script still
|
||||
# expects Ekklesia's deployment tree at build/workspace, which the removed ci/assemble.sh used to
|
||||
# build; it is rewritten when Signage is installed into the generic image as a Module Package.
|
||||
set -Eeuo pipefail
|
||||
|
||||
root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
workspace="$root/build/workspace"
|
||||
[[ -f "$workspace/deploy/Dockerfile" ]] || {
|
||||
echo "integration: Ekklesia's deployment tree is not at build/workspace." >&2
|
||||
platform="$root/build/platform"
|
||||
release="$root/build/module-package"
|
||||
[[ -f "$platform/scripts/smoke-deploy.sh" ]] || {
|
||||
echo "integration: run bash ci/fetch-platform.sh first." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Named and labeled as a CI stack of this run and job (the platform's scripts/lib/ci-project.sh), so
|
||||
# the workflow's final `ci-sweep.sh --job` removes it even if this script is killed before its trap.
|
||||
# shellcheck source=/dev/null
|
||||
source "$workspace/scripts/lib/ci-project.sh"
|
||||
project="$(ci_project_name signage-image)"
|
||||
image="${project}:latest"
|
||||
trap 'docker image rm --force "$image" >/dev/null 2>&1 || true' EXIT
|
||||
source_revision="${GITHUB_SHA:-$(git -C "$root" rev-parse HEAD 2>/dev/null || true)}"
|
||||
[[ "$source_revision" =~ ^[0-9a-f]{40}$ ]] || {
|
||||
echo "integration: no full source revision is available for the package." >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
rm -rf "$release"
|
||||
mkdir -p "$release"
|
||||
pnpm --dir "$root" build
|
||||
pnpm --dir "$root" exec ekklesia-pack-module --module "$root" --target linux-x64-glibc \
|
||||
--out "$release" --license-file "$root/LICENSE" --source-revision "$source_revision"
|
||||
|
||||
scenarios="$(sed -e 's/#.*//' -e '/^[[:space:]]*$/d' "$root/ci/display-scenarios" | tr '\n' ' ')"
|
||||
[[ -n "${scenarios// /}" ]] || {
|
||||
echo "integration: ci/display-scenarios lists no scenario." >&2
|
||||
exit 1
|
||||
}
|
||||
echo "integration: external Signage package built; scenarios: ${scenarios}"
|
||||
|
||||
DOCKER_BUILDKIT=1 docker build --quiet --file "$workspace/deploy/Dockerfile" --tag "$image" \
|
||||
--label "${EKKLESIA_CI_LABEL}=${project}" --label "${EKKLESIA_CI_CREATED_LABEL}=$(date +%s)" \
|
||||
"$workspace" >/dev/null
|
||||
echo "integration: built the deployment image with Signage; scenarios: ${scenarios}"
|
||||
|
||||
cd "$workspace"
|
||||
cd "$platform"
|
||||
EKKLESIA_SMOKE_TOPOLOGY=split \
|
||||
EKKLESIA_SMOKE_IMAGE="$image" \
|
||||
EKKLESIA_SMOKE_MODULE_RELEASE_DIR="$release" \
|
||||
EKKLESIA_SMOKE_MODULE_ID=signage \
|
||||
EKKLESIA_SMOKE_MODULE_PROBE_PATH=/api/v1/modules/signage/channel-groups \
|
||||
EKKLESIA_SMOKE_DISPLAY_DEVICE=1 \
|
||||
EKKLESIA_SMOKE_DISPLAY_SCENARIOS="$scenarios" \
|
||||
EKKLESIA_SMOKE_WATCH_MS=120000 \
|
||||
|
||||
Reference in New Issue
Block a user