78 lines
2.7 KiB
Bash
78 lines
2.7 KiB
Bash
#!/usr/bin/env bash
|
|
#
|
|
# Local release pipeline for the Qt6-migrated legatus validation scope
|
|
# (TetraIF, Z, Lts/Common + Lts/Proxies/TrainingAreaBase).
|
|
#
|
|
# Runs the in-tree new_docker_build.sh:
|
|
# - builds the prebuilt Docker image from the in-tree Dockerfile when the
|
|
# image is not present yet
|
|
# - 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 ${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/
|
|
# (Jenkins-style layout; locally WORKSPACE is the pipeline root).
|
|
#
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
LEGATUS_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|
PIPELINE_ROOT="${LEGATUS_ROOT}"
|
|
|
|
# Release build configuration (Jenkins-style variables)
|
|
export WORKSPACE="${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}"
|
|
|
|
# Build the prebuilt image from the in-tree Dockerfile when not present yet
|
|
# (--build-prebuilt-image builds the image and exits)
|
|
if ! docker image inspect "${DOCKER_IMAGE}" >/dev/null 2>&1; then
|
|
log_info "Prebuilt image not found - building it from the in-tree Dockerfile..."
|
|
bash ./new_docker_build.sh --build-prebuilt-image --docker-image "${DOCKER_IMAGE}"
|
|
fi
|
|
|
|
# Release scope build + ctest + DEB production (in-tree rpmbuild)
|
|
bash ./new_docker_build.sh \
|
|
--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.sh \
|
|
--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 ==="
|