#!/usr/bin/env bash # Gives the canonical linux-x64-glibc Module Package pair from the package job 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/package.sh # bash ci/fetch-platform.sh # bash ci/integration.sh set -Eeuo pipefail root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)" platform="$root/build/platform" release="${1:-$root/build/module-package}" [[ -f "$platform/scripts/smoke-deploy.sh" ]] || { echo "integration: run bash ci/fetch-platform.sh first." >&2 exit 1 } mapfile -t archives < <(find "$release" -maxdepth 1 -type f -name 'signage-*-linux-x64-glibc.tar.gz' -print) [[ "${#archives[@]}" -eq 1 ]] || { echo "integration: expected exactly one prebuilt Module Package archive." >&2 exit 1 } archive="${archives[0]}" checksum="$archive.sha256" [[ -f "$checksum" ]] || { echo "integration: missing $(basename "$checksum")." >&2 exit 1 } (cd "$release" && sha256sum --check --strict "$(basename "$checksum")") digest="$(sha256sum "$archive" | cut -d' ' -f1)" if [[ -n "${EXPECTED_PACKAGE_SHA256:-}" && "$digest" != "$EXPECTED_PACKAGE_SHA256" ]]; then echo "integration: prebuilt package sha256 $digest differs from the package job's $EXPECTED_PACKAGE_SHA256." >&2 exit 1 fi 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: consuming prebuilt $(basename "$archive"); scenarios: ${scenarios}" cd "$platform" EKKLESIA_SMOKE_TOPOLOGY=split \ 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 \ EKKLESIA_SMOKE_RECYCLE_WATCH_MS=120000 \ bash scripts/smoke-deploy.sh