#!/usr/bin/env bash # # Local release pipeline for the Qt6-migrated legatus Release 2 scope # (AP3, AP4, AP9, TetraIF, tests - 46 targets). # # Runs the in-tree new_docker_build_release2.sh: # - uses the prebuilt Docker image when present; otherwise the driver # installs the dependencies in-container from the base image (slower) # - builds the release scope, runs ctest and produces the release DEB # packages with the in-tree rpmbuild script # - collects the lcov code-coverage report (--run-coverage; set # DRYRUN_COVERAGE=OFF to skip) # # The DEB packages land in ${MIGRATE_PIPELINE_ROOT}/rpms/${PROJECT}/${OS_VERSION}/ # (Jenkins-style layout; locally the pipeline root is the directory that # contains qt-migration-legatus/). # set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" LEGATUS_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" # Tree layout: /qt-migration-legatus/qt6-after/qt6-migrated-legatus PIPELINE_ROOT="$(cd "${LEGATUS_ROOT}/../../.." && pwd)" # Release build configuration (Jenkins-style variables) export WORKSPACE="${PIPELINE_ROOT}" export MIGRATE_PIPELINE_ROOT="${MIGRATE_PIPELINE_ROOT:-${PIPELINE_ROOT}}" export PROJECT="${PROJECT:-guez}" export OS_VERSION="${OS_VERSION:-26.04}" export LTS_VERSION="${LTS_VERSION:-1.0}" export GUEZ_MODE="${GUEZ_MODE:-ON}" export BUILD_NUMBER="${BUILD_NUMBER:-$(date +%Y%m%d-%H%M%S)}" export BUILD_TAG="${BUILD_TAG:-release-qt6-first}" DOCKER_IMAGE="${DOCKER_IMAGE:-legatus-qt6:1.0}" log_info() { printf 'INFO: %s\n' "$*" } log_info "=== Qt6 Release Pipeline ===" log_info "Pipeline root: ${PIPELINE_ROOT}" log_info "Legatus root: ${LEGATUS_ROOT}" log_info "Docker image: ${DOCKER_IMAGE}" log_info "Build number: ${BUILD_NUMBER}" log_info "Build tag: ${BUILD_TAG}" log_info "Package output: ${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/" cd "${LEGATUS_ROOT}" # Use the prebuilt image when present; otherwise let the driver install the # dependencies in-container from the base image (slower, no image build). PREBUILT_FLAG=() if docker image inspect "${DOCKER_IMAGE}" >/dev/null 2>&1; then PREBUILT_FLAG=(--use-prebuilt-image) log_info "Using prebuilt image ${DOCKER_IMAGE}" else log_info "Prebuilt image ${DOCKER_IMAGE} not found - the driver will install dependencies in-container" fi # Release scope build + ctest + DEB production (in-tree rpmbuild) bash ./new_docker_build_release2.sh \ "${PREBUILT_FLAG[@]}" \ --docker-image "${DOCKER_IMAGE}" \ --run-jenkins-builder \ --package-output-dir "${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/" \ --project "${PROJECT}" \ --lts-version "${LTS_VERSION}" \ --build-number "${BUILD_NUMBER}" \ --build-tag "${BUILD_TAG}" # Code coverage (lcov) - mirrors the Jenkins Coverage stage. Set # DRYRUN_COVERAGE=OFF for a fast local DEB-only run. DRYRUN_COVERAGE="${DRYRUN_COVERAGE:-ON}" if [[ "${DRYRUN_COVERAGE}" == "ON" ]]; then bash ./new_docker_build_release2.sh \ "${PREBUILT_FLAG[@]}" \ --docker-image "${DOCKER_IMAGE}" \ --run-coverage \ --coverage-output-dir "${WORKSPACE}/coverage/${PROJECT}/${OS_VERSION}" else log_info "Coverage skipped (DRYRUN_COVERAGE=OFF)" fi log_info "=== Release Pipeline Complete ==="