Compare commits
11
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e97806442f | ||
|
|
37dffeab46 | ||
|
|
e563800a85 | ||
|
|
d130c55be5 | ||
|
|
0e2100f383 | ||
|
|
26f702b7a4 | ||
|
|
37bd700564 | ||
|
|
684e05109d | ||
|
|
676ae05335 | ||
|
|
a17b431669 | ||
|
|
493893d2e6 |
No files matched your search
@@ -14,3 +14,4 @@ build/
|
|||||||
build2/
|
build2/
|
||||||
.envrc
|
.envrc
|
||||||
build4
|
build4
|
||||||
|
coverage-out/
|
||||||
@@ -4,12 +4,6 @@
|
|||||||
# $Author$
|
# $Author$
|
||||||
#
|
#
|
||||||
|
|
||||||
# Release scope: modules with DDS/RTI dependencies not needed for TetraIF/Z are excluded
|
|
||||||
# DDS-dependent modules: CodeGen, LtsAppManager, LtsBotan, LtsCoordinate, LtsElevation,
|
|
||||||
# LtsLogin, LtsMultiMonitor, LtsPluginManager, LtsPrinting, LtsProjectionWorkstation,
|
|
||||||
# LtsScriptTimeline, LtsSession, LtsTimelineClassic, LtsVirtualKeyboard, LtsWidgets,
|
|
||||||
# PluginInterfaces (TopicReplayInterface, RecordReplayPlugin), TopicEditorBase
|
|
||||||
|
|
||||||
# Core modules needed for TetraIF and Z
|
# Core modules needed for TetraIF and Z
|
||||||
ADD_SUBDIRECTORY(CommonUnitTestsPlaceholder)
|
ADD_SUBDIRECTORY(CommonUnitTestsPlaceholder)
|
||||||
ADD_SUBDIRECTORY(httq)
|
ADD_SUBDIRECTORY(httq)
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Stub GTest smoke test for coordTrans
|
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
TEST(CoordTransSmokeTest, StubTest)
|
TEST(CoordTransSmokeTest, StubTest)
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
// Stub QtTest smoke test for coordTrans
|
|
||||||
#include <QTest>
|
#include <QTest>
|
||||||
|
|
||||||
class CoordTransSmokeTest : public QObject
|
class CoordTransSmokeTest : public QObject
|
||||||
|
|||||||
-2
@@ -1,5 +1,3 @@
|
|||||||
// MockCoordTrans.h - Stub mock for CoordTrans functionality
|
|
||||||
// This is a placeholder to allow builds without full CoordTrans implementation
|
|
||||||
|
|
||||||
#ifndef MOCK_COORD_TRANS_H
|
#ifndef MOCK_COORD_TRANS_H
|
||||||
#define MOCK_COORD_TRANS_H
|
#define MOCK_COORD_TRANS_H
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ NGL_TARGET_LINK_LIBRARIES(LtsAppDescriptor
|
|||||||
|
|
||||||
NGL_INSTALL_TARGET(LtsAppDescriptor)
|
NGL_INSTALL_TARGET(LtsAppDescriptor)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# LtsAppDescriptorChecker
|
# LtsAppDescriptorChecker
|
||||||
SET(LtsAppDescriptorChecker_SRCS
|
SET(LtsAppDescriptorChecker_SRCS
|
||||||
checker/main.cpp
|
checker/main.cpp
|
||||||
@@ -51,27 +49,6 @@ NGL_TARGET_LINK_LIBRARIES(LtsAppDescriptorChecker
|
|||||||
Qt6::Core
|
Qt6::Core
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# LtsAppDescriptorEditor => Hat niemand benutzt, wird keiner benutzen, also wird der bis auf Weiteres auch nicht an die neue Syntax angepasst.
|
|
||||||
#SET(LtsAppDescriptorEditor_SRCS
|
|
||||||
# lts_app_descriptor_editor.cpp
|
|
||||||
# lts_app_descriptor_editor.h
|
|
||||||
#)
|
|
||||||
|
|
||||||
#NGL_WRAP_UI(LtsAppDescriptorEditor_SRCS
|
|
||||||
# lts_app_descriptor_editor.ui
|
|
||||||
#)
|
|
||||||
|
|
||||||
#NGL_ADD_LIBRARY2(WS NO_TRANSLATION LtsAppDescriptorEditor SHARED ${LtsAppDescriptorEditor_SRCS})
|
|
||||||
|
|
||||||
#NGL_TARGET_INCLUDE_DIRECTORIES(LtsAppDescriptorEditor
|
|
||||||
# PUBLIC
|
|
||||||
# ${CMAKE_CURRENT_SOURCE_DIR}/../
|
|
||||||
#)
|
|
||||||
|
|
||||||
if(QT6_GUI_AVAILABLE)
|
if(QT6_GUI_AVAILABLE)
|
||||||
#NGL_TARGET_LINK_LIBRARIES(LtsAppDescriptorEditor
|
#NGL_TARGET_LINK_LIBRARIES(LtsAppDescriptorEditor
|
||||||
# PUBLIC
|
# PUBLIC
|
||||||
|
|||||||
@@ -1,14 +1,6 @@
|
|||||||
# Modified CMakeLists.txt from github.com/wille-io/httq
|
# Modified CMakeLists.txt from github.com/wille-io/httq
|
||||||
|
|
||||||
# Make ${Qt6_WebSockets} optional
|
# Make ${Qt6_WebSockets} optional
|
||||||
# Link the real WebSockets module whenever the websocket code path is
|
|
||||||
# compiled: QT6_WEBSOCKETS_AVAILABLE (root CMakeLists) and the manual
|
|
||||||
# Qt6::WebSockets import are set when the real module was found. The old
|
|
||||||
# QT6_GUI_AVAILABLE condition never held in this environment (Qt6
|
|
||||||
# discovery takes the minimal path) and the Qt6_WebSockets variable was
|
|
||||||
# never defined, so AbstractServer.cpp compiled the websocket code
|
|
||||||
# without the module on the link line (undefined reference to
|
|
||||||
# QWebSocketServer::handleConnection).
|
|
||||||
if(QT6_WEBSOCKETS_REAL_FOUND OR Qt6WebSockets_FOUND)
|
if(QT6_WEBSOCKETS_REAL_FOUND OR Qt6WebSockets_FOUND)
|
||||||
set(Qt6_WebSockets Qt6::WebSockets)
|
set(Qt6_WebSockets Qt6::WebSockets)
|
||||||
else()
|
else()
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ SET(SRCS_telegrams
|
|||||||
training_area_telegrams.h
|
training_area_telegrams.h
|
||||||
)
|
)
|
||||||
NGL_ADD_LIBRARY(AAR SV WS HLA tabTelegrams STATIC ${SRCS_telegrams})
|
NGL_ADD_LIBRARY(AAR SV WS HLA tabTelegrams STATIC ${SRCS_telegrams})
|
||||||
|
|
||||||
|
# tabTelegrams is a STATIC lib linked into shared/MODULE targets
|
||||||
|
SET_TARGET_PROPERTIES(tabTelegrams PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||||
NGL_TARGET_INCLUDE_DIRECTORIES(tabTelegrams
|
NGL_TARGET_INCLUDE_DIRECTORIES(tabTelegrams
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/..
|
${CMAKE_CURRENT_SOURCE_DIR}/..
|
||||||
@@ -78,8 +81,6 @@ LIST(APPEND SRCS_common
|
|||||||
# Create target only if component flags allow
|
# Create target only if component flags allow
|
||||||
NGL_ADD_LIBRARY2(AAR SV WS HLA svcTabCommon SHARED ${SRCS_common})
|
NGL_ADD_LIBRARY2(AAR SV WS HLA svcTabCommon SHARED ${SRCS_common})
|
||||||
|
|
||||||
# Generate export header ALWAYS (needed for logger.h even if target not built)
|
|
||||||
# Use custom command to create minimal export header if target wasn't created
|
|
||||||
IF(NOT TARGET svcTabCommon)
|
IF(NOT TARGET svcTabCommon)
|
||||||
# Create a dummy static library just for export header generation
|
# Create a dummy static library just for export header generation
|
||||||
ADD_LIBRARY(svcTabCommon STATIC ${SRCS_common})
|
ADD_LIBRARY(svcTabCommon STATIC ${SRCS_common})
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// Stub file for tab_db - BUILD_RTI=OFF
|
|
||||||
// Auto-generated stub to replace RTI IDL-generated database code
|
|
||||||
|
|
||||||
#ifndef TAB_DB_STUB_HPP
|
#ifndef TAB_DB_STUB_HPP
|
||||||
#define TAB_DB_STUB_HPP
|
#define TAB_DB_STUB_HPP
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// Stub file for tab_enums - BUILD_RTI=OFF
|
|
||||||
// Auto-generated stub to replace RTI IDL-generated enums
|
|
||||||
|
|
||||||
#ifndef TAB_ENUMS_STUB_HPP
|
#ifndef TAB_ENUMS_STUB_HPP
|
||||||
#define TAB_ENUMS_STUB_HPP
|
#define TAB_ENUMS_STUB_HPP
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
// Stub file for tab types - BUILD_RTI=OFF
|
|
||||||
// Auto-generated stub to replace RTI IDL-generated types
|
|
||||||
|
|
||||||
#ifndef TAB_STUB_HPP
|
#ifndef TAB_STUB_HPP
|
||||||
#define TAB_STUB_HPP
|
#define TAB_STUB_HPP
|
||||||
|
|
||||||
|
|||||||
-3
@@ -1,6 +1,3 @@
|
|||||||
// Stub file for tab_topic_type_plugin - BUILD_RTI=OFF
|
|
||||||
// Auto-generated stub to replace RTI IDL-generated plugin code
|
|
||||||
|
|
||||||
#include "tab_enums_stub.hpp"
|
#include "tab_enums_stub.hpp"
|
||||||
|
|
||||||
namespace tab
|
namespace tab
|
||||||
|
|||||||
-5
@@ -1,5 +1,3 @@
|
|||||||
// Stub file for pdm - BUILD_RTI=OFF
|
|
||||||
// Auto-generated stub to replace RTI IDL-generated code
|
|
||||||
|
|
||||||
#ifndef PDM_HPP
|
#ifndef PDM_HPP
|
||||||
#define PDM_HPP
|
#define PDM_HPP
|
||||||
@@ -10,9 +8,6 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
// Forward declarations and stub types for ProjectDataManagement namespace
|
|
||||||
// Used when BUILD_RTI=OFF to allow compilation without RTI Connext DDS
|
|
||||||
|
|
||||||
namespace ProjectDataManagement
|
namespace ProjectDataManagement
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
-3
@@ -1,6 +1,3 @@
|
|||||||
// Stub file for pdm_db - BUILD_RTI=OFF
|
|
||||||
// Auto-generated stub to replace RTI IDL-generated database code
|
|
||||||
|
|
||||||
#ifndef PDM_DB_STUB_HPP
|
#ifndef PDM_DB_STUB_HPP
|
||||||
#define PDM_DB_STUB_HPP
|
#define PDM_DB_STUB_HPP
|
||||||
|
|
||||||
|
|||||||
-2
@@ -1,5 +1,3 @@
|
|||||||
// Stub file for pdm_enums - BUILD_RTI=OFF
|
|
||||||
// Auto-generated stub to replace RTI IDL-generated code
|
|
||||||
|
|
||||||
#ifndef PDM_ENUMS_STUB_HPP
|
#ifndef PDM_ENUMS_STUB_HPP
|
||||||
#define PDM_ENUMS_STUB_HPP
|
#define PDM_ENUMS_STUB_HPP
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
// Stub file for pdm - BUILD_RTI=OFF
|
|
||||||
// Auto-generated stub to replace RTI IDL-generated code
|
|
||||||
|
|
||||||
#ifndef PDM_STUB_HPP
|
#ifndef PDM_STUB_HPP
|
||||||
#define PDM_STUB_HPP
|
#define PDM_STUB_HPP
|
||||||
|
|||||||
@@ -1,30 +1,51 @@
|
|||||||
# qt6-migrated-legatus — compile and run (step by step)
|
# qt6-migrated-legatus — Release 2 Build Guide
|
||||||
|
|
||||||
Build guide for the Qt6-migrated legatus tree on the release
|
Build guide for the Qt6-migrated legatus tree for **Release 2** (guez project).
|
||||||
**validation-scope** branch. Everything runs inside a prebuilt Docker
|
Everything runs inside a prebuilt Docker image; the host only needs Docker.
|
||||||
image; the host only needs Docker.
|
|
||||||
|
|
||||||
## Scope and layout
|
## Release 2 Scope
|
||||||
|
|
||||||
The release scope built by `new_docker_build.sh` is:
|
**Release 2 includes all Release 1 packages plus new modules:**
|
||||||
|
|
||||||
| Area | Contents |
|
| Area | Contents | Targets |
|
||||||
|---|---|
|
|---|---|---|
|
||||||
| `TetraIF/` | `CoPrtCnv`, `LogView`, `PrtCnv` (+ `unit-test/` — see below) |
|
| **Release 1 Packages** | TetraIF, Z module, Lts/Common, Tests | 35 targets |
|
||||||
| `Z/src/` | NGL application/core library stack (NGLLogger, nglcoreapplication, …) |
|
| **AP3 — Shared Libraries** | LtsUtils, Widgets, Session, Krypto, PluginManager | 6 targets |
|
||||||
| `Lts/Common/` | LTS common libraries (LtsCoordTrans, LtsLicence, …) |
|
| **AP4 — DDS Middleware** | Core, DDSConnector, Routing, QosProfile, RTI DDS compatibility | 6 targets |
|
||||||
| `Lts/Proxies/TrainingAreaBase` | built as a dependency of TetraIF |
|
| **AP9 — Tools & Translations** | DdsView, LogViewer, SqlBrowser, generators, lupdate toolchain | 4 targets |
|
||||||
|
|
||||||
Useful entries at the tree root:
|
**Total: 38 targets** across 4 build groups (GROUP1, GROUP3, GROUP5, GROUP6)
|
||||||
|
|
||||||
- `new_docker_build.sh` — the build driver (image build, compile, ctest, DEB packaging)
|
### Target Breakdown
|
||||||
|
|
||||||
|
| Group | Area | Targets | Count |
|
||||||
|
|---|---|---|---|
|
||||||
|
| **GROUP1** | DDS/AP4 | ddscore, ddsftccore, ddsfts, ddsgen, ddsQoS, ddsconnector | 6 |
|
||||||
|
| **GROUP3** | Lts/AP3/TetraIF/Tests | NGL (14), Lts (4), Plugin Interfaces (2), AP3 Libraries (4), Release 1 Additions (2), Tests (7) | 28 |
|
||||||
|
| **GROUP5** | Viewer/AP9 | ddsview, LogViewer, sqlbrowser | 3 |
|
||||||
|
| **GROUP6** | Tools/AP9 | ngl_codegen | 1 |
|
||||||
|
|
||||||
|
### Release 1 Modules Included
|
||||||
|
|
||||||
|
| Module | Targets | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| **TetraIF** | 5 | CoPrtCnv, LogView, LogViewLogger, PrtCnv, PrtCnvLib |
|
||||||
|
| **Z Module** | 16 | NGL application/core library stack (NGLLogger, nglapplication, nglcompression, nglcoreapplication, ngldb, nglguiapplication, nglsettings, nglsingleapplication, nglsinglecoreapplication, ngltools, ngltranslator, nglwidgets, qtsingleapplication, qtsinglecoreapplication) |
|
||||||
|
| **Lts/Common** | 3 | LtsCoordinate, LtsCoordTrans, LtsMultiMonitor |
|
||||||
|
| **Tests** | 7 | aes_crypt_test, ngltools_qt_smoke, lts_coord_trans_unit_test, test_nglpdfwidget, coprtcnv_unit_test, logview_unit_test, prtcnv_unit_test |
|
||||||
|
| **Additional** | 2 | LtsLicence, MockCoordTrans |
|
||||||
|
|
||||||
|
## Entries at the tree root
|
||||||
|
|
||||||
|
- `new_docker_build_release2.sh` — Release 2 build driver (image build, compile, ctest, DEB packaging)
|
||||||
- `Dockerfile` — recipe of the prebuilt build image (Ubuntu 26.04 + Qt 6.10.2 + deps)
|
- `Dockerfile` — recipe of the prebuilt build image (Ubuntu 26.04 + Qt 6.10.2 + deps)
|
||||||
- `rpmbuild/make_rpm_ubuntu26.py` — in-tree DEB package producer (self-contained)
|
- `rpmbuild/make_rpm_ubuntu26_release2.py` — Release 2 DEB package producer (5 packages)
|
||||||
- `jenkins-ci-rme/` — in-tree copy of the Jenkins CI flow (see its own `README.md`)
|
- `jenkins-ci-rme/` — in-tree copy of the Jenkins CI flow (see its own `README.md`)
|
||||||
- `build4/` — build tree, created by the driver (git-ignored scratch area)
|
- `build4/` — build tree, created by the driver (git-ignored scratch area)
|
||||||
|
|
||||||
Toolchain inside the image: **Ubuntu 26.04, GCC 15.2.0, Qt 6.10.2**
|
**Toolchain inside the image:** Ubuntu 26.04, GCC 15.2.0, Qt 6.10.2 (`/opt/Qt/6.10.2/gcc_64`), C++17, Release build.
|
||||||
(`/opt/Qt/6.10.2/gcc_64`), C++17, Release build.
|
|
||||||
|
**Qt Installation:** Qt 6.10.2 installed via `aqt install-qt` (no apt Qt6 packages).
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
@@ -32,45 +53,43 @@ Toolchain inside the image: **Ubuntu 26.04, GCC 15.2.0, Qt 6.10.2**
|
|||||||
2. The tree must be reachable inside the container at
|
2. The tree must be reachable inside the container at
|
||||||
`/workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus`, i.e.
|
`/workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus`, i.e.
|
||||||
mount the pipeline root on `/workspace` — this is how
|
mount the pipeline root on `/workspace` — this is how
|
||||||
`new_docker_build.sh` invokes Docker, so running the driver as-is
|
`new_docker_build_release2.sh` invokes Docker, so running the driver as-is
|
||||||
satisfies this.
|
satisfies this.
|
||||||
|
|
||||||
No license file is required: the RTI Connext DDS modules (the only
|
The driver resolves the pipeline root from its own location (override
|
||||||
consumers of an RTI license) are not part of the release scope and are
|
with the exported `MIGRATE_PIPELINE_ROOT` or the `.envrc` in this
|
||||||
never compiled on this branch.
|
directory).
|
||||||
`new_docker_build.sh` resolves the pipeline root from its own location
|
|
||||||
(override with the exported `MIGRATE_PIPELINE_ROOT` or the `.envrc` in
|
|
||||||
this directory).
|
|
||||||
|
|
||||||
All commands below are run **from this directory** (`qt6-migrated-legatus/`).
|
All commands below are run **from this directory**
|
||||||
|
(`qt6-migrated-legatus/`).
|
||||||
|
|
||||||
## Step 1 — Build the prebuilt Docker image (once)
|
## Step 1 — Build the prebuilt Docker image (once)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./new_docker_build.sh --build-prebuilt-image --docker-image legatus-qt6:1.0
|
./new_docker_build_release2.sh --build-prebuilt-image --docker-image guez-release2:2.0
|
||||||
```
|
```
|
||||||
|
|
||||||
This builds the image from the in-tree `Dockerfile` (Ubuntu 26.04 base,
|
This builds the image from the in-tree `Dockerfile` (Ubuntu 26.04 base,
|
||||||
apt deps, Qt 6.10.2 via `aqtinstall`, KDReports from source). Re-run it
|
apt deps, Qt 6.10.2 via `aqtinstall`, KDReports from source). Re-run it
|
||||||
only after changing the `Dockerfile` or the `APT_PACKAGES` list in
|
only after changing the `Dockerfile` or the `APT_PACKAGES` list in
|
||||||
`new_docker_build.sh`.
|
`new_docker_build_release2.sh`.
|
||||||
|
|
||||||
To remove it later:
|
To remove it later:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./new_docker_build.sh --delete-prebuilt-image --docker-image legatus-qt6:1.0
|
./new_docker_build_release2.sh --delete-prebuilt-image --docker-image guez-release2:2.0
|
||||||
```
|
```
|
||||||
|
|
||||||
## Step 2 — Compile the release scope
|
## Step 2 — Compile the Release 2 scope
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./new_docker_build.sh --docker-image legatus-qt6:1.0
|
./new_docker_build_release2.sh --docker-image guez-release2:2.0
|
||||||
```
|
```
|
||||||
|
|
||||||
What the driver does inside the container:
|
What the driver does inside the container:
|
||||||
|
|
||||||
1. `rm -rf build4 && mkdir build4 && cd build4` (fresh build tree)
|
1. `rm -rf build4 && mkdir build4 && cd build4` (fresh build tree)
|
||||||
2. Configure with CMake — the mandatory flags:
|
2. Configure with CMake:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cmake .. \
|
cmake .. \
|
||||||
@@ -81,22 +100,42 @@ What the driver does inside the container:
|
|||||||
-DCMAKE_PREFIX_PATH=/opt/Qt/6.10.2/gcc_64:/usr/local
|
-DCMAKE_PREFIX_PATH=/opt/Qt/6.10.2/gcc_64:/usr/local
|
||||||
```
|
```
|
||||||
|
|
||||||
(`RELEASE_BUILD=ON` selects the release scope; everything else is at
|
(`RELEASE_BUILD=ON` selects the Release 2 scope; everything else is at
|
||||||
its CMake default.)
|
its CMake default.)
|
||||||
3. `make -j8` the release-scope targets (TetraIF modules, Z stack,
|
3. `make -j8` the Release 2 scope targets (38 targets across GROUP1, GROUP3, GROUP5, GROUP6 — the list is
|
||||||
Lts/Common libs, all test executables — the list is
|
`RELEASE_BUILD_TARGETS` in `new_docker_build_release2.sh`).
|
||||||
`RELEASE_BUILD_TARGETS` in `new_docker_build.sh`).
|
|
||||||
4. Run **ctest** (see Step 3).
|
4. Run **ctest** (see Step 3).
|
||||||
|
|
||||||
Output to inspect after the run:
|
Output to inspect after the run:
|
||||||
|
|
||||||
- `build4/release_build.log` — full make output (the build must end with
|
- `build4/release_build.log` — full make output
|
||||||
**0 warnings**)
|
|
||||||
- `build4/bin/` — executables (apps + test binaries)
|
- `build4/bin/` — executables (apps + test binaries)
|
||||||
- `build4/lib/` — shared libraries
|
- `build4/lib/` — shared libraries
|
||||||
|
|
||||||
To rebuild incrementally without a fresh tree, run `make` directly in an
|
To rebuild incrementally without a fresh tree, run `make` directly in an
|
||||||
interactive container (Step 4).
|
interactive container against the existing `build4/`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm -it -v /path/to/pipeline-root:/workspace guez-release2:2.0 \
|
||||||
|
bash -c 'cd /workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus/build4 \
|
||||||
|
&& make -j8'
|
||||||
|
```
|
||||||
|
|
||||||
|
## Run an executable directly
|
||||||
|
|
||||||
|
To run a built executable interactively — e.g. the GUI apps under
|
||||||
|
`build4/bin/` (`LogView`, `PrtCnv`) against your local display — start a
|
||||||
|
shell inside the container with X11 forwarding:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run --rm -it \
|
||||||
|
-e DISPLAY \
|
||||||
|
-e LC_ALL=C.UTF-8 \
|
||||||
|
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||||
|
-v /path/to/pipeline-root:/workspace \
|
||||||
|
legatus-qt6:1.0 \
|
||||||
|
bash -c 'cd /workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus/build4 && exec bash'
|
||||||
|
```
|
||||||
|
|
||||||
## Step 3 — Run the tests
|
## Step 3 — Run the tests
|
||||||
|
|
||||||
@@ -145,7 +184,7 @@ ctest --output-on-failure'
|
|||||||
Each QtTest binary accepts a single slot name to run just one test,
|
Each QtTest binary accepts a single slot name to run just one test,
|
||||||
e.g. `./bin/coprtcnv_unit_test radioTelegramFragmentationRoundtrip`.
|
e.g. `./bin/coprtcnv_unit_test radioTelegramFragmentationRoundtrip`.
|
||||||
|
|
||||||
### 3.4 TetraIF unit tests (this tree, `TetraIF/unit-test/`)
|
### 3.4 TetraIF unit tests (`TetraIF/unit-test/`)
|
||||||
|
|
||||||
| Test | Module covered | Note |
|
| Test | Module covered | Note |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
@@ -156,14 +195,14 @@ e.g. `./bin/coprtcnv_unit_test radioTelegramFragmentationRoundtrip`.
|
|||||||
Sources are registered with ctest via `TetraIF/unit-test/CMakeLists.txt`
|
Sources are registered with ctest via `TetraIF/unit-test/CMakeLists.txt`
|
||||||
and packaged into the ctest DEBs (see Step 4).
|
and packaged into the ctest DEBs (see Step 4).
|
||||||
|
|
||||||
## Step 4 — Produce the release DEB packages
|
## Step 4 — Produce the Release 2 DEB packages
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export WORKSPACE=/path/to/pipeline-root # e.g. ~/release/qt6-migration-pipeline
|
export WORKSPACE=/path/to/pipeline-root # e.g. ~/release/qt6-migration-pipeline
|
||||||
export PROJECT=guez
|
export PROJECT=guez
|
||||||
export OS_VERSION=26.04
|
export OS_VERSION=26.04
|
||||||
|
|
||||||
./new_docker_build.sh --docker-image legatus-qt6:1.0 \
|
./new_docker_build_release2.sh --docker-image guez-release2:2.0 \
|
||||||
--run-jenkins-builder \
|
--run-jenkins-builder \
|
||||||
--package-output-dir "${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/" \
|
--package-output-dir "${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/" \
|
||||||
> /path/to/build.log 2>&1
|
> /path/to/build.log 2>&1
|
||||||
@@ -172,22 +211,22 @@ export OS_VERSION=26.04
|
|||||||
(export the variables *before* the command — command-prefix variables are
|
(export the variables *before* the command — command-prefix variables are
|
||||||
not expanded in the same command's arguments.)
|
not expanded in the same command's arguments.)
|
||||||
|
|
||||||
The driver compiles the release scope, runs ctest, then stages the tree
|
The driver compiles the Release 2 scope (38 targets), runs ctest,
|
||||||
and runs the in-tree `rpmbuild/make_rpm_ubuntu26.py`, which produces 5
|
then stages the tree and runs the in-tree `rpmbuild/make_rpm_ubuntu26_release2.py`,
|
||||||
DEBs in `${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/`:
|
which produces 5 DEBs in `${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/`:
|
||||||
|
|
||||||
| DEB | Contents |
|
| DEB | Contents |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `qt6-release-runtime_*` | runtime libraries + the release-scope executables |
|
| `guez-runtime_2.0_amd64.deb` | Runtime libraries (Lts, AP3, AP4, TetraIF, Z) + executables |
|
||||||
| `qt6-release-sources_*` | release-scope sources |
|
| `guez-sources_2.0_amd64.deb` | Release 2 scope sources |
|
||||||
| `qt6-release-ctest-runtime_*` | test executables under `/usr/lib/ctest/` (incl. the TetraIF unit tests) |
|
| `guez-ctest-runtime_2.0_amd64.deb` | Test executables under `/usr/lib/ctest/` (13 tests incl. TetraIF unit tests) |
|
||||||
| `qt6-release-ctest-sources_*` | test sources (files with "test" in the name under the release dirs, incl. `TetraIF/unit-test/*.cpp`) |
|
| `guez-ctest-sources_2.0_amd64.deb` | Test sources (files with "test" in the name under release dirs) |
|
||||||
| `qt6-release-build-pipeline_*` | the in-tree pipeline files (`new_docker_build.sh`, `Dockerfile`, `rpmbuild/`, `jenkins-ci-rme/`) under `/usr/src/pipeline/` |
|
| `guez-build-pipeline_2.0_amd64.deb` | Pipeline files (`new_docker_build_release2.sh`, `Dockerfile`, `CMakeLists.txt`, `rpmbuild/`, `jenkins-ci-rme/`) under `/usr/src/pipeline/` |
|
||||||
|
|
||||||
Verify a package:
|
Verify a package:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
dpkg -c "${WORKSPACE}/rpms/guez/26.04/qt6-release-ctest-runtime_1.0-1_amd64.deb" \
|
dpkg -c "${WORKSPACE}/rpms/guez/26.04/guez-ctest-runtime_2.0_amd64.deb" \
|
||||||
| grep unit_test
|
| grep unit_test
|
||||||
dpkg -i "${WORKSPACE}/rpms/guez/26.04/"*.deb # install locally, if wanted
|
dpkg -i "${WORKSPACE}/rpms/guez/26.04/"*.deb # install locally, if wanted
|
||||||
```
|
```
|
||||||
@@ -207,23 +246,65 @@ jenkins-ci-rme/release-16-10-2026.sh
|
|||||||
|
|
||||||
See `jenkins-ci-rme/README.md` for the pipeline details.
|
See `jenkins-ci-rme/README.md` for the pipeline details.
|
||||||
|
|
||||||
|
## Step 6 — Code coverage (lcov)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export WORKSPACE=/path/to/pipeline-root # e.g. ~/release/qt6-migration-pipeline
|
||||||
|
export PROJECT=guez
|
||||||
|
export OS_VERSION=26.04
|
||||||
|
|
||||||
|
./new_docker_build_release2.sh --docker-image guez-release2:2.0 \
|
||||||
|
--run-coverage \
|
||||||
|
--coverage-output-dir "${WORKSPACE}/coverage/${PROJECT}/${OS_VERSION}/" \
|
||||||
|
> /path/to/coverage.log 2>&1
|
||||||
|
```
|
||||||
|
|
||||||
|
(export the variables *before* the command — command-prefix variables are
|
||||||
|
not expanded in the same command's arguments.)
|
||||||
|
|
||||||
|
The driver builds the Release 2 scope with `-O0 --coverage`, runs the same ctest
|
||||||
|
suite (13 tests), then captures the data with lcov: the report covers the Release 2 scope
|
||||||
|
(AP3, AP4, AP9, TetraIF, Z/src, Lts/Common, Lts/Proxies/TrainingAreaBase), and test
|
||||||
|
sources are filtered out of the report, so the percentages reflect the module
|
||||||
|
code.
|
||||||
|
|
||||||
|
Artifacts in the coverage output directory:
|
||||||
|
|
||||||
|
| File | Contents |
|
||||||
|
|---|---|
|
||||||
|
| `html/index.html` | browsable report (line + branch coverage per file) |
|
||||||
|
| `coverage.info` | machine-readable lcov tracefile |
|
||||||
|
| `coverage_summary.txt` | whole-scope totals |
|
||||||
|
|
||||||
|
`--run-coverage` is mutually exclusive with `--run-jenkins-builder` (different
|
||||||
|
instrumentation of the same build tree).
|
||||||
|
|
||||||
|
The Jenkins pipeline runs the same step on every build (`RunCoverage`
|
||||||
|
parameter, on by default) and archives the report as build artifacts under
|
||||||
|
`coverage/<project>/<os>/`; the local dry run
|
||||||
|
(`jenkins-ci-rme/release-16-10-2026.sh`) does the same, with
|
||||||
|
`DRYRUN_COVERAGE=OFF` to skip coverage there.
|
||||||
|
|
||||||
## Options reference
|
## Options reference
|
||||||
|
|
||||||
`./new_docker_build.sh --help` prints the full option list. The main
|
`./new_docker_build_release2.sh --help` prints the full option list. The main
|
||||||
ones:
|
ones:
|
||||||
|
|
||||||
| Option | Default | Purpose |
|
| Option | Default | Purpose |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `--docker-image IMAGE` | `legatus-qt6-prebuilt:latest` | image to use/build/delete |
|
| `--docker-image IMAGE` | `guez-release2:2.0` | image to use/build/delete |
|
||||||
| `--build-prebuilt-image` | — | build the image from `./Dockerfile` and exit |
|
| `--build-prebuilt-image` | — | build the image from `./Dockerfile` and exit |
|
||||||
| `--delete-prebuilt-image` | — | delete the image and exit |
|
| `--delete-prebuilt-image` | — | delete the image and exit |
|
||||||
| `--run-jenkins-builder` | off | produce the DEB packages (Step 4) |
|
| `--run-jenkins-builder` | off | produce the DEB packages (Step 4) |
|
||||||
| `--package-output-dir DIR` | `./packages-out` | where the DEBs are written |
|
| `--package-output-dir DIR` | `./packages-out` | where the DEBs are written |
|
||||||
| `--lts-version / --project / --build-number / --build-tag` | `1.0` / `guez` / `1` / `manual-build` | package metadata |
|
| `--lts-version / --project / --build-number / --build-tag` | `2.0` / `guez` / `1` / `manual-build` | package metadata |
|
||||||
|
| `--run-coverage` | off | coverage build + lcov report (Step 6) |
|
||||||
|
| `--coverage-output-dir DIR` | `./coverage-out` | where the coverage report is written |
|
||||||
|
|
||||||
Environment overrides: `DOCKER_IMAGE`, `RUN_JENKINS_BUILDER`,
|
Environment overrides: `DOCKER_IMAGE`, `RUN_JENKINS_BUILDER`,
|
||||||
`PACKAGE_OUTPUT_DIR`, `PROJECT`, `LTS_VERSION`, `GUEZ_MODE`,
|
`PACKAGE_OUTPUT_DIR`, `RUN_COVERAGE`, `COVERAGE_OUTPUT_DIR`, `PROJECT`,
|
||||||
`BUILD_NUMBER`, `BUILD_TAG`, `MIGRATE_PIPELINE_ROOT`.
|
`LTS_VERSION`, `GUEZ_MODE`, `BUILD_NUMBER`, `BUILD_TAG`,
|
||||||
|
`MIGRATE_PIPELINE_ROOT`.
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
@@ -234,3 +315,6 @@ Environment overrides: `DOCKER_IMAGE`, `RUN_JENKINS_BUILDER`,
|
|||||||
- **DEBs not on the host** → the output dir must be a path that exists
|
- **DEBs not on the host** → the output dir must be a path that exists
|
||||||
*on the host* (it is bind-mounted into the container as
|
*on the host* (it is bind-mounted into the container as
|
||||||
`/workspace/packages-out`); check the `package-output-dir` argument.
|
`/workspace/packages-out`); check the `package-output-dir` argument.
|
||||||
|
- **Build fails with missing Qt modules** → ensure the container uses
|
||||||
|
`new_docker_build_release2.sh` which installs Qt 6.10.2 via `aqt install-qt`.
|
||||||
|
The image must be `guez-release2:2.0` (not `legatus-qt6:1.0`).
|
||||||
@@ -14,6 +14,8 @@ NGL_TARGET_LINK_LIBRARIES(LogViewLogger
|
|||||||
NGLLogger
|
NGLLogger
|
||||||
)
|
)
|
||||||
|
|
||||||
|
SET_TARGET_PROPERTIES(LogViewLogger PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||||
|
|
||||||
SET(my_SRCS
|
SET(my_SRCS
|
||||||
IntegerCalculator.cpp
|
IntegerCalculator.cpp
|
||||||
IntegerCalculator.hpp
|
IntegerCalculator.hpp
|
||||||
|
|||||||
@@ -15,4 +15,26 @@
|
|||||||
<file>image/ShowSend.png</file>
|
<file>image/ShowSend.png</file>
|
||||||
<file>image/Wls.png</file>
|
<file>image/Wls.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
<qresource prefix="/icons/16x16">
|
||||||
|
<file alias="configure.png">../../Z/src/nglwidgets/icons/16x16/configure.png</file>
|
||||||
|
<file alias="dialog-ok-apply.png">../../Z/src/nglwidgets/icons/16x16/dialog-ok-apply.png</file>
|
||||||
|
<file alias="document-edit.png">../../Z/src/nglwidgets/icons/16x16/document-edit.png</file>
|
||||||
|
<file alias="document-import.png">../../Z/src/nglwidgets/icons/16x16/document-import.png</file>
|
||||||
|
<file alias="document-new.png">../../Z/src/nglwidgets/icons/16x16/document-new.png</file>
|
||||||
|
<file alias="document-open-data.png">../../Z/src/nglwidgets/icons/16x16/document-open-data.png</file>
|
||||||
|
<file alias="document-save.png">../../Z/src/nglwidgets/icons/16x16/document-save.png</file>
|
||||||
|
<file alias="edit-copy.png">../../Z/src/nglwidgets/icons/16x16/edit-copy.png</file>
|
||||||
|
<file alias="edit-delete.png">../../Z/src/nglwidgets/icons/16x16/edit-delete.png</file>
|
||||||
|
<file alias="edit-paste.png">../../Z/src/nglwidgets/icons/16x16/edit-paste.png</file>
|
||||||
|
<file alias="edit-redo.png">../../Z/src/nglwidgets/icons/16x16/edit-redo.png</file>
|
||||||
|
<file alias="go-down.png">../../Z/src/nglwidgets/icons/16x16/go-down.png</file>
|
||||||
|
<file alias="go-up.png">../../Z/src/nglwidgets/icons/16x16/go-up.png</file>
|
||||||
|
<file alias="list-add.png">../../Z/src/nglwidgets/icons/16x16/list-add.png</file>
|
||||||
|
<file alias="list-remove.png">../../Z/src/nglwidgets/icons/16x16/list-remove.png</file>
|
||||||
|
<file alias="mail-send.png">../../Z/src/nglwidgets/icons/16x16/mail-send.png</file>
|
||||||
|
<file alias="media-play-normal.png">../../Z/src/nglwidgets/icons/16x16/media-play-normal.png</file>
|
||||||
|
<file alias="media-playback-start.png">../../Z/src/nglwidgets/icons/16x16/media-playback-start.png</file>
|
||||||
|
<file alias="media-playback-stop.png">../../Z/src/nglwidgets/icons/16x16/media-playback-stop.png</file>
|
||||||
|
<file alias="rde_16x16.png">../../Z/src/nglwidgets/icons/16x16/rde_16x16.png</file>
|
||||||
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
@@ -83,11 +83,13 @@ NGL_WRAP_UI(nglwidgets_SRCS
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Collect big resource QRCs
|
# Collect big resource QRCs
|
||||||
set(oxygen_SRCS nglresources.qrc)
|
set(oxygen_SRCS)
|
||||||
if(TARGET Qt6::Core)
|
if(TARGET Qt6::Core)
|
||||||
# Use Qt6's CMake helper to generate resource sources so resources are available at runtime
|
# Use Qt6's CMake helper to generate resource sources so resources are available at runtime.
|
||||||
qt_add_resources(RME_LIGHT_RCC rme_light_style.qrc)
|
# Both qrcs MUST go through qt_add_resources: a raw .qrc left in the source list is not
|
||||||
list(APPEND oxygen_SRCS ${RME_LIGHT_RCC})
|
# compiled (CMAKE_AUTORCC is off), so its resources would be missing at runtime
|
||||||
|
# (e.g. :icons/16x16/* toolbar/window icons used by LogView).
|
||||||
|
qt_add_resources(oxygen_SRCS nglresources.qrc rme_light_style.qrc)
|
||||||
else()
|
else()
|
||||||
NGL_ADD_BIG_RESOURCES(oxygen_SRCS nglresources.qrc rme_light_style.qrc)
|
NGL_ADD_BIG_RESOURCES(oxygen_SRCS nglresources.qrc rme_light_style.qrc)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -38,11 +38,20 @@ if(POLICY CMP0177)
|
|||||||
cmake_policy(SET CMP0177 OLD)
|
cmake_policy(SET CMP0177 OLD)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Compatibility stubs for Qt5 CMake macros when Qt6 is used.
|
# Compatibility stubs for Qt5 CMake macros when Qt6 is used (UI/CPP wrapping
|
||||||
# These stubs allow configure to succeed; actual resource/ui generation should be addressed during source migration.
|
# still no-op; resource handling is implemented below).
|
||||||
|
# QT5_ADD_RESOURCES maps onto Qt6's qt6_add_resources() in the outfiles-variable
|
||||||
|
# form: the generated qrc_<name>.cpp sources are appended to the given source
|
||||||
|
# list, so .qrc files are compiled into the targets that reference them
|
||||||
|
# (e.g. TetraIF/LogView). Without this the resources are silently dropped and
|
||||||
|
# ":/..." icons render empty at runtime.
|
||||||
if(NOT COMMAND QT5_ADD_RESOURCES)
|
if(NOT COMMAND QT5_ADD_RESOURCES)
|
||||||
macro(QT5_ADD_RESOURCES _out)
|
macro(QT5_ADD_RESOURCES _out)
|
||||||
set(${_out} "" PARENT_SCOPE)
|
if(TARGET Qt6::Core)
|
||||||
|
qt6_add_resources(${_out} ${ARGN})
|
||||||
|
else()
|
||||||
|
message(WARNING "QT5_ADD_RESOURCES stub: Qt6::Core not found, skipping resources: ${ARGN}")
|
||||||
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
if(NOT COMMAND QT5_ADD_BIG_RESOURCES)
|
if(NOT COMMAND QT5_ADD_BIG_RESOURCES)
|
||||||
|
|||||||
+19
-125
@@ -1,140 +1,34 @@
|
|||||||
// Release pipeline for the Qt6-migrated legatus validation-scope branch
|
// Entry point of the release pipeline for the Qt6-migrated legatus
|
||||||
// (story/release-validation-scope): TetraIF, Z, Lts/Common (+
|
// validation-scope branch (story/release-validation-scope).
|
||||||
// Lts/Proxies/TrainingAreaBase) -> 5 release DEB packages.
|
|
||||||
//
|
//
|
||||||
// Workspace layout (checked out by Jenkins, outer pipeline repo):
|
// Lives in jenkins-ci-rme/ of the DLBO Qt6 repo. Declares the job properties,
|
||||||
// <WORKSPACE>/
|
// allocates the build node, checks out the repo with its submodules and
|
||||||
// external/
|
// loads the build body from jenkins-ci-rme/jenkins/Jenkinsfile.
|
||||||
// qt-migration-legatus/qt6-after/qt6-migrated-legatus/ <- LEGATUS_ROOT
|
|
||||||
// Dockerfile (prebuilt build image recipe)
|
|
||||||
// new_docker_build.sh (local build driver)
|
|
||||||
// rpmbuild/make_rpm_ubuntu26.py (in-tree packaging)
|
|
||||||
// jenkins-ci-rme/ (this pipeline)
|
|
||||||
//
|
|
||||||
// The build container image is the prebuilt image built from the in-tree
|
|
||||||
// Dockerfile; it is built on the agent when not present (RebuildImage
|
|
||||||
// forces a fresh build).
|
|
||||||
|
|
||||||
def project = 'guez'
|
|
||||||
def legatusRoot = 'qt-migration-legatus/qt6-after/qt6-migrated-legatus'
|
|
||||||
def imageName = 'legatus-qt6-prebuilt:latest'
|
|
||||||
|
|
||||||
properties([
|
properties([
|
||||||
disableConcurrentBuilds(),
|
disableConcurrentBuilds(),
|
||||||
parameters([
|
parameters([
|
||||||
string(name: 'OsVersions', defaultValue: '26.04', description: 'Comma-separated Ubuntu base versions, all built in parallel'),
|
choice(name: 'ProjectName', choices: ['guez'], description: 'LTS project flavor (passed to make_rpm_ubuntu26.py --project_name)'),
|
||||||
|
string(name: 'OsVersions', defaultValue: '26.04', description: 'Comma-separated Ubuntu base versions, built sequentially'),
|
||||||
string(name: 'LtsVersion', defaultValue: '1.0', description: 'LTS version (major.minor) passed to make_rpm_ubuntu26.py --version'),
|
string(name: 'LtsVersion', defaultValue: '1.0', description: 'LTS version (major.minor) passed to make_rpm_ubuntu26.py --version'),
|
||||||
booleanParam(name: 'ClearWorkspace', defaultValue: false, description: 'Clear entire workspace on all nodes used for build'),
|
booleanParam(name: 'ClearWorkspace', defaultValue: false, description: 'Clear entire workspace used for build'),
|
||||||
booleanParam(name: 'PublishArtifactRepo', defaultValue: true, description: 'Upload produced DEBs to the internal artifact repository'),
|
booleanParam(name: 'PublishArtifactRepo', defaultValue: true, description: 'Upload produced DEBs to the internal artifact repository'),
|
||||||
booleanParam(name: 'RebuildImage', defaultValue: false, description: 'Rebuild the prebuilt build image from the in-tree Dockerfile (default: reuse when present)')
|
booleanParam(name: 'RunCoverage', defaultValue: true, description: 'Build the release scope with -O0 --coverage, run ctest, collect the lcov report and archive it')
|
||||||
])
|
])
|
||||||
])
|
])
|
||||||
|
|
||||||
env.GIT_TERMINAL_PROMPT = '0'
|
node('jenkins-linux-node-2.sl.defence-elec.de') {
|
||||||
env.LTS_VERSION = "${params.LtsVersion}"
|
stage('Init submodule') {
|
||||||
env.ARTIFACTREPO = 'https://internal-repo.sl.defence-elec.de'
|
|
||||||
|
|
||||||
// OS versions this build covers; every build is isolated under
|
|
||||||
// rpms/${project}/${osVersion} so concurrent OS builds never collide.
|
|
||||||
def osVersions = params.OsVersions.split(',').collect { it.trim() }.findAll { it }
|
|
||||||
|
|
||||||
def builds = [:]
|
|
||||||
osVersions.each { osVersion ->
|
|
||||||
def rpmsDir = "rpms/${project}/${osVersion}"
|
|
||||||
|
|
||||||
builds["${project} (${osVersion})"] = {
|
|
||||||
stage("Prepare ${project} (${osVersion})") {
|
|
||||||
sh "rm -rf ${rpmsDir}"
|
|
||||||
sh "mkdir -p ${rpmsDir}"
|
|
||||||
}
|
|
||||||
|
|
||||||
stage("Prepare build image ${project} (${osVersion})") {
|
|
||||||
if (params.RebuildImage) {
|
|
||||||
sh "docker rmi ${imageName} || true"
|
|
||||||
}
|
|
||||||
// The in-tree driver owns the Dockerfile build args (APT_PACKAGES,
|
|
||||||
// QT_VERSION, ...) - single source of truth.
|
|
||||||
sh """
|
|
||||||
if docker image inspect ${imageName} >/dev/null 2>&1; then
|
|
||||||
echo "Reusing existing prebuilt image ${imageName}"
|
|
||||||
else
|
|
||||||
echo "Building prebuilt image ${imageName} from the in-tree Dockerfile..."
|
|
||||||
cd ${legatusRoot} && bash ./new_docker_build.sh --build-prebuilt-image --docker-image ${imageName}
|
|
||||||
fi
|
|
||||||
"""
|
|
||||||
}
|
|
||||||
|
|
||||||
stage("Build DEB ${project} (${osVersion})") {
|
|
||||||
def buildContainer = docker.image("${imageName}")
|
|
||||||
def guezMode = (project == 'guez') ? 'ON' : 'OFF'
|
|
||||||
|
|
||||||
def dockerOpts = "--init --shm-size=2g" +
|
|
||||||
" -v ${WORKSPACE}:/workspace" +
|
|
||||||
" -e WORKSPACE=/workspace" +
|
|
||||||
" -e PROJECT_BASE_DIR=/workspace" +
|
|
||||||
" -e PROJECT=${project}" +
|
|
||||||
" -e OS_VERSION=${osVersion}" +
|
|
||||||
" -e LTS_VERSION=${LTS_VERSION}" +
|
|
||||||
" -e GUEZ_MODE=${guezMode}" +
|
|
||||||
" -e BUILD_NUMBER=${env.BUILD_NUMBER}" +
|
|
||||||
" -e BUILD_TAG=${env.BUILD_TAG}"
|
|
||||||
|
|
||||||
buildContainer.inside(dockerOpts) {
|
|
||||||
sh "bash /workspace/${legatusRoot}/jenkins-ci-rme/jenkins_builder_ubuntu26.sh"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage("Publish ${project} (${osVersion})") {
|
|
||||||
if (params.PublishArtifactRepo) {
|
|
||||||
withCredentials([usernamePassword(credentialsId: 'internal-repo-uploader',
|
|
||||||
usernameVariable: 'CURL_USER',
|
|
||||||
passwordVariable: 'CURL_PASS')]) {
|
|
||||||
sh """
|
|
||||||
export CURL_CRED="\${CURL_USER}:\${CURL_PASS}"
|
|
||||||
export PROJECT='${project}'
|
|
||||||
export OS_VERSION='${osVersion}'
|
|
||||||
export LTS_VERSION='${LTS_VERSION}'
|
|
||||||
export BUILD_NUMBER='${env.BUILD_NUMBER}'
|
|
||||||
export ARTIFACTREPO='${env.ARTIFACTREPO}'
|
|
||||||
export ARTIFACTFOLDER='${project}'
|
|
||||||
bash ${legatusRoot}/jenkins-ci-rme/jenkins_publisher_ubuntu26.sh
|
|
||||||
"""
|
|
||||||
}
|
|
||||||
|
|
||||||
def tdsUrl = readFile("url-${project}-${osVersion}.txt").trim()
|
|
||||||
def tdsVersion = readFile("tdsversion-${project}-${osVersion}.txt").trim()
|
|
||||||
def link = """<a href="${tdsUrl}" target="_blank">${project} ${tdsVersion} (OS ${osVersion})</a>"""
|
|
||||||
currentBuild.description = currentBuild.description ? "${currentBuild.description}<br/>${link}" : link
|
|
||||||
} else {
|
|
||||||
echo "Artifact-repo publish skipped for ${project} (OS ${osVersion}, PublishArtifactRepo=false)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
stage("Initialization") {
|
|
||||||
if (params.ClearWorkspace) {
|
if (params.ClearWorkspace) {
|
||||||
cleanWs()
|
cleanWs()
|
||||||
checkout([
|
|
||||||
$class: 'GitSCM',
|
|
||||||
branches: scm.branches,
|
|
||||||
doGenerateSubmoduleConfigurations: false,
|
|
||||||
extensions: [[$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: true, reference: '', trackingSubmodules: false]],
|
|
||||||
userRemoteConfigs: scm.userRemoteConfigs
|
|
||||||
])
|
|
||||||
}
|
}
|
||||||
echo "Legatus Qt6 release build initialized — branch '${env.BRANCH_NAME}', project: ${project}, LTS ${env.LTS_VERSION}, OS version(s): ${osVersions.join(', ')}"
|
checkout([
|
||||||
|
$class: 'GitSCM',
|
||||||
|
branches: scm.branches,
|
||||||
|
doGenerateSubmoduleConfigurations: false,
|
||||||
|
extensions: [[$class: 'SubmoduleOption', disableSubmodules: false, parentCredentials: true, recursiveSubmodules: true, reference: '', trackingSubmodules: false]],
|
||||||
|
userRemoteConfigs: scm.userRemoteConfigs
|
||||||
|
])
|
||||||
}
|
}
|
||||||
|
load 'jenkins-ci-rme/jenkins/Jenkinsfile'
|
||||||
parallel builds
|
|
||||||
|
|
||||||
stage("Finalization") {
|
|
||||||
echo "Legatus Qt6 release build completed — project: ${project} (LTS ${env.LTS_VERSION}), OS version(s): ${osVersions.join(', ')}"
|
|
||||||
}
|
|
||||||
|
|
||||||
currentBuild.result = 'SUCCESS'
|
|
||||||
} catch (e) {
|
|
||||||
currentBuild.result = 'FAILURE'
|
|
||||||
throw e
|
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,8 @@ only on files inside this source tree:
|
|||||||
|
|
||||||
| File | Purpose |
|
| File | Purpose |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `Jenkinsfile` | Jenkins pipeline: prepare the prebuilt image (in-tree `Dockerfile`), run the builder inside the container, publish the DEBs to the artifact repo |
|
| `Jenkinsfile` | Jenkins entry point (job script path `jenkins-ci-rme/Jenkinsfile`): job properties/parameters, build node, checkout with submodules, then `load`s `jenkins-ci-rme/jenkins/Jenkinsfile` |
|
||||||
|
| `jenkins/Jenkinsfile` | Build body (per OS version, sequentially): install the prebuilt image from `legatus-qt6_1.0.tar.gz` when missing, run the builder inside the container, coverage, publish the DEBs to the artifact repo |
|
||||||
| `jenkins_builder_ubuntu26.sh` | Runs **inside** the build container: stages the workspace, runs the in-tree `rpmbuild/make_rpm_ubuntu26.py`, copies the DEBs to the packages-out mount |
|
| `jenkins_builder_ubuntu26.sh` | Runs **inside** the build container: stages the workspace, runs the in-tree `rpmbuild/make_rpm_ubuntu26.py`, copies the DEBs to the packages-out mount |
|
||||||
| `jenkins_publisher_ubuntu26.sh` | Runs on the Jenkins agent: uploads the DEBs from `${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/` to the internal artifact repository |
|
| `jenkins_publisher_ubuntu26.sh` | Runs on the Jenkins agent: uploads the DEBs from `${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/` to the internal artifact repository |
|
||||||
| `release-16-10-2026.sh` | Local driver: the same flow without Jenkins, through the in-tree `new_docker_build.sh` |
|
| `release-16-10-2026.sh` | Local driver: the same flow without Jenkins, through the in-tree `new_docker_build.sh` |
|
||||||
@@ -24,9 +25,9 @@ only on files inside this source tree:
|
|||||||
|
|
||||||
- Packaging uses the **in-tree** `rpmbuild/make_rpm_ubuntu26.py`
|
- Packaging uses the **in-tree** `rpmbuild/make_rpm_ubuntu26.py`
|
||||||
(was `${WORKSPACE}/rpmbuild` from the outer repo)
|
(was `${WORKSPACE}/rpmbuild` from the outer repo)
|
||||||
- The prebuilt build image is built from the **in-tree** `Dockerfile` via
|
- The prebuilt build image `legatus-qt6:1.0` ships in the repo as
|
||||||
`new_docker_build.sh --build-prebuilt-image` (was a pre-pulled harbor
|
`legatus-qt6_1.0.tar.gz` (repo root); Jenkins `docker load`s it only when
|
||||||
image) — build args stay in `new_docker_build.sh` (single source of truth)
|
the image is not installed on the agent yet, and never builds it
|
||||||
- `MIGRATE_PIPELINE_ROOT` is no longer needed: `new_docker_build.sh`
|
- `MIGRATE_PIPELINE_ROOT` is no longer needed: `new_docker_build.sh`
|
||||||
derives it from its own location
|
derives it from its own location
|
||||||
- DEB output path: `${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/` (Jenkins
|
- DEB output path: `${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/` (Jenkins
|
||||||
@@ -40,15 +41,14 @@ only on files inside this source tree:
|
|||||||
## Local run
|
## Local run
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd qt6-migrated-legatus
|
cd "DLBO Qt6"
|
||||||
bash ./jenkins-ci-rme/release-16-10-2026.sh
|
bash ./jenkins-ci-rme/release-16-10-2026.sh
|
||||||
# DEBs: <pipeline-root>/rpms/guez/26.04/
|
# DEBs: <repo-root>/rpms/guez/26.04/
|
||||||
```
|
```
|
||||||
|
|
||||||
## Jenkins setup
|
## Jenkins setup
|
||||||
|
|
||||||
The job SCM must be the outer pipeline repository (the Jenkinsfile lives in
|
The job SCM is the DLBO Qt6 repository; the script path is
|
||||||
the `qt-migration-legatus` submodule; point the job's script path at
|
`jenkins-ci-rme/Jenkinsfile`, which loads `jenkins-ci-rme/jenkins/Jenkinsfile`.
|
||||||
`qt-migration-legatus/qt6-after/qt6-migrated-legatus/jenkins-ci-rme/Jenkinsfile`).
|
|
||||||
Required Jenkins credential: `internal-repo-uploader` (username/password for
|
Required Jenkins credential: `internal-repo-uploader` (username/password for
|
||||||
the artifact repository).
|
the artifact repository).
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
// Build body of the release pipeline for the Qt6-migrated legatus
|
||||||
|
// validation-scope branch (story/release-validation-scope): TetraIF, Z,
|
||||||
|
// Lts/Common (+ Lts/Proxies/TrainingAreaBase) -> 5 release DEB packages.
|
||||||
|
//
|
||||||
|
// Loaded by jenkins-ci-rme/Jenkinsfile inside the allocated node after the
|
||||||
|
// checkout; job properties/parameters live there.
|
||||||
|
//
|
||||||
|
// Workspace layout (checked out by Jenkins, DLBO Qt6 repo):
|
||||||
|
// <WORKSPACE>/
|
||||||
|
// jenkins-ci-rme/Jenkinsfile (entry point)
|
||||||
|
// new_docker_build.sh (local build driver)
|
||||||
|
// rpmbuild/make_rpm_ubuntu26.py (in-tree packaging)
|
||||||
|
// jenkins-ci-rme/ (this pipeline)
|
||||||
|
//
|
||||||
|
// The build container image is the prebuilt image shipped in the repo as
|
||||||
|
// legatus-qt6_1.0.tar.gz; it is loaded onto the agent when not installed
|
||||||
|
// yet, never built here.
|
||||||
|
|
||||||
|
def project = params.ProjectName
|
||||||
|
def imageName = 'legatus-qt6:1.0'
|
||||||
|
def imageArchive = 'legatus-qt6_1.0.tar.gz'
|
||||||
|
|
||||||
|
env.GIT_TERMINAL_PROMPT = '0'
|
||||||
|
env.LTS_VERSION = "${params.LtsVersion}"
|
||||||
|
env.ARTIFACTREPO = 'https://internal-repo.sl.defence-elec.de'
|
||||||
|
|
||||||
|
// OS versions this build covers, built one after another (the builder
|
||||||
|
// stages the workspace into a shared deb_stage directory); output is
|
||||||
|
// still isolated under rpms/${project}/${osVersion}.
|
||||||
|
def osVersions = params.OsVersions.split(',').collect { it.trim() }.findAll { it }
|
||||||
|
|
||||||
|
def buildOsVersion = { String osVersion ->
|
||||||
|
def rpmsDir = "rpms/${project}/${osVersion}"
|
||||||
|
|
||||||
|
stage("Prepare ${project} (${osVersion})") {
|
||||||
|
sh "rm -rf ${rpmsDir}"
|
||||||
|
sh "mkdir -p ${rpmsDir}"
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("Build DEB ${project} (${osVersion})") {
|
||||||
|
def buildContainer = docker.image("${imageName}")
|
||||||
|
def guezMode = (project == 'guez') ? 'ON' : 'OFF'
|
||||||
|
|
||||||
|
def dockerOpts = "--init --shm-size=2g" +
|
||||||
|
" -v ${WORKSPACE}:/workspace" +
|
||||||
|
" -e WORKSPACE=/workspace" +
|
||||||
|
" -e PROJECT_BASE_DIR=/workspace" +
|
||||||
|
" -e PROJECT=${project}" +
|
||||||
|
" -e OS_VERSION=${osVersion}" +
|
||||||
|
" -e LTS_VERSION=${LTS_VERSION}" +
|
||||||
|
" -e GUEZ_MODE=${guezMode}" +
|
||||||
|
" -e BUILD_NUMBER=${env.BUILD_NUMBER}" +
|
||||||
|
" -e BUILD_TAG=${env.BUILD_TAG}"
|
||||||
|
|
||||||
|
buildContainer.inside(dockerOpts) {
|
||||||
|
sh "bash /workspace/jenkins-ci-rme/jenkins_builder_ubuntu26.sh"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("Coverage ${project} (${osVersion})") {
|
||||||
|
if (!params.RunCoverage) {
|
||||||
|
echo "Coverage skipped for ${project} (OS ${osVersion}, RunCoverage=false)"
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// The driver (run on the agent, same pattern as the image-build
|
||||||
|
// stage) builds the scope with -O0 --coverage, runs ctest and
|
||||||
|
// collects the lcov report into the workspace mount.
|
||||||
|
sh "bash ./new_docker_build.sh --docker-image ${imageName} --run-coverage --coverage-output-dir ${WORKSPACE}/coverage/${project}/${osVersion}"
|
||||||
|
archiveArtifacts artifacts: "coverage/${project}/${osVersion}/**", allowEmptyArchive: true
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("Publish ${project} (${osVersion})") {
|
||||||
|
if (params.PublishArtifactRepo) {
|
||||||
|
withCredentials([usernamePassword(credentialsId: 'internal-repo-uploader',
|
||||||
|
usernameVariable: 'CURL_USER',
|
||||||
|
passwordVariable: 'CURL_PASS')]) {
|
||||||
|
sh """
|
||||||
|
export CURL_CRED="\${CURL_USER}:\${CURL_PASS}"
|
||||||
|
export PROJECT='${project}'
|
||||||
|
export OS_VERSION='${osVersion}'
|
||||||
|
export LTS_VERSION='${LTS_VERSION}'
|
||||||
|
export BUILD_NUMBER='${env.BUILD_NUMBER}'
|
||||||
|
export ARTIFACTREPO='${env.ARTIFACTREPO}'
|
||||||
|
export ARTIFACTFOLDER='${project}'
|
||||||
|
bash jenkins-ci-rme/jenkins_publisher_ubuntu26.sh
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
|
||||||
|
def tdsUrl = readFile("url-${project}-${osVersion}.txt").trim()
|
||||||
|
def tdsVersion = readFile("tdsversion-${project}-${osVersion}.txt").trim()
|
||||||
|
def link = """<a href="${tdsUrl}" target="_blank">${project} ${tdsVersion} (OS ${osVersion})</a>"""
|
||||||
|
currentBuild.description = currentBuild.description ? "${currentBuild.description}<br/>${link}" : link
|
||||||
|
} else {
|
||||||
|
echo "Artifact-repo publish skipped for ${project} (OS ${osVersion}, PublishArtifactRepo=false)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
stage("Initialization") {
|
||||||
|
echo "Legatus Qt6 release build initialized — branch '${env.BRANCH_NAME}', project: ${project}, LTS ${env.LTS_VERSION}, OS version(s): ${osVersions.join(', ')}"
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("Install build image") {
|
||||||
|
// Reuse the prebuilt image when it is already installed on the agent;
|
||||||
|
// otherwise load it from the archive shipped in the repo.
|
||||||
|
def imageInstalled = sh(script: "docker image inspect '${imageName}' >/dev/null 2>&1", returnStatus: true) == 0
|
||||||
|
if (imageInstalled) {
|
||||||
|
echo "Build image ${imageName} is already installed on the agent - reusing it"
|
||||||
|
} else {
|
||||||
|
if (!fileExists(imageArchive)) {
|
||||||
|
error "Build image ${imageName} not installed and image archive ${imageArchive} not found in the workspace"
|
||||||
|
}
|
||||||
|
echo "Build image ${imageName} not installed on the agent - loading it from ${imageArchive}"
|
||||||
|
sh "docker load -i '${imageArchive}'"
|
||||||
|
if (sh(script: "docker image inspect '${imageName}' >/dev/null 2>&1", returnStatus: true) != 0) {
|
||||||
|
error "Build image ${imageName} still not available after loading ${imageArchive}"
|
||||||
|
}
|
||||||
|
echo "Build image ${imageName} installed on the agent"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (osVersion in osVersions) {
|
||||||
|
buildOsVersion(osVersion)
|
||||||
|
}
|
||||||
|
|
||||||
|
stage("Finalization") {
|
||||||
|
echo "Legatus Qt6 release build completed — project: ${project} (LTS ${env.LTS_VERSION}), OS version(s): ${osVersions.join(', ')}"
|
||||||
|
}
|
||||||
|
|
||||||
|
currentBuild.result = 'SUCCESS'
|
||||||
|
} catch (e) {
|
||||||
|
currentBuild.result = 'FAILURE'
|
||||||
|
throw e
|
||||||
|
}
|
||||||
Executable → Regular
+4
-3
@@ -7,7 +7,7 @@
|
|||||||
# Runs inside the prebuilt build container (built from the in-tree
|
# Runs inside the prebuilt build container (built from the in-tree
|
||||||
# Dockerfile) with the pipeline workspace mounted at /workspace.
|
# Dockerfile) with the pipeline workspace mounted at /workspace.
|
||||||
# Packaging is done by the IN-TREE rpmbuild copy
|
# Packaging is done by the IN-TREE rpmbuild copy
|
||||||
# (qt-migration-legatus/qt6-after/qt6-migrated-legatus/rpmbuild/), so the
|
# (rpmbuild/ at the DLBO Qt6 repo root), so the
|
||||||
# release flow needs no files outside the source tree.
|
# release flow needs no files outside the source tree.
|
||||||
#
|
#
|
||||||
# Required environment (set by the Jenkinsfile or `docker run -e ...`):
|
# Required environment (set by the Jenkinsfile or `docker run -e ...`):
|
||||||
@@ -41,13 +41,14 @@ rm -rf "${STAGE_DIR}"
|
|||||||
mkdir -p "${STAGE_DIR}"
|
mkdir -p "${STAGE_DIR}"
|
||||||
tar --exclude='./rpms' --exclude='./.git' --exclude='./build' \
|
tar --exclude='./rpms' --exclude='./.git' --exclude='./build' \
|
||||||
--exclude='./deb_build_tmp' --exclude='./deb_stage' --exclude='./packages-out' \
|
--exclude='./deb_build_tmp' --exclude='./deb_stage' --exclude='./packages-out' \
|
||||||
|
--exclude='./legatus-qt6_1.0.tar.gz' \
|
||||||
-cf - -C "${WORKSPACE}" . | tar -xf - -C "${STAGE_DIR}"
|
-cf - -C "${WORKSPACE}" . | tar -xf - -C "${STAGE_DIR}"
|
||||||
|
|
||||||
export VERSION_DATE
|
export VERSION_DATE
|
||||||
VERSION_DATE=$(date +%Y-%m-%d)
|
VERSION_DATE=$(date +%Y-%m-%d)
|
||||||
|
|
||||||
# Real CMake project root inside the staged tree (the in-tree source)
|
# CMake project root inside the staged tree (the DLBO Qt6 repo root)
|
||||||
SOURCE_DIR="${STAGE_DIR}/qt-migration-legatus/qt6-after/qt6-migrated-legatus"
|
SOURCE_DIR="${STAGE_DIR}"
|
||||||
if [ ! -f "${SOURCE_DIR}/CMakeLists.txt" ] || [ ! -f "${SOURCE_DIR}/rpmbuild/make_rpm_ubuntu26.py" ]; then
|
if [ ! -f "${SOURCE_DIR}/CMakeLists.txt" ] || [ ! -f "${SOURCE_DIR}/rpmbuild/make_rpm_ubuntu26.py" ]; then
|
||||||
echo "ERROR: staged source incomplete under ${SOURCE_DIR} (CMakeLists.txt or rpmbuild/make_rpm_ubuntu26.py missing)" >&2
|
echo "ERROR: staged source incomplete under ${SOURCE_DIR} (CMakeLists.txt or rpmbuild/make_rpm_ubuntu26.py missing)" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Executable → Regular
File mode changed.
Executable → Regular
+16
-2
@@ -8,6 +8,8 @@
|
|||||||
# image is not present yet
|
# image is not present yet
|
||||||
# - builds the release scope, runs ctest and produces the release DEB
|
# - builds the release scope, runs ctest and produces the release DEB
|
||||||
# packages with the in-tree rpmbuild script
|
# 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}/
|
# The DEB packages land in ${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/
|
||||||
# (Jenkins-style layout; locally WORKSPACE is the pipeline root).
|
# (Jenkins-style layout; locally WORKSPACE is the pipeline root).
|
||||||
@@ -16,7 +18,7 @@ set -euo pipefail
|
|||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
LEGATUS_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
LEGATUS_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||||
PIPELINE_ROOT="$(cd "${LEGATUS_ROOT}/../../.." && pwd)"
|
PIPELINE_ROOT="${LEGATUS_ROOT}"
|
||||||
|
|
||||||
# Release build configuration (Jenkins-style variables)
|
# Release build configuration (Jenkins-style variables)
|
||||||
export WORKSPACE="${PIPELINE_ROOT}"
|
export WORKSPACE="${PIPELINE_ROOT}"
|
||||||
@@ -27,7 +29,7 @@ export GUEZ_MODE="${GUEZ_MODE:-ON}"
|
|||||||
export BUILD_NUMBER="${BUILD_NUMBER:-$(date +%Y%m%d-%H%M%S)}"
|
export BUILD_NUMBER="${BUILD_NUMBER:-$(date +%Y%m%d-%H%M%S)}"
|
||||||
export BUILD_TAG="${BUILD_TAG:-release-qt6-first}"
|
export BUILD_TAG="${BUILD_TAG:-release-qt6-first}"
|
||||||
|
|
||||||
DOCKER_IMAGE="${DOCKER_IMAGE:-legatus-qt6-prebuilt:latest}"
|
DOCKER_IMAGE="${DOCKER_IMAGE:-legatus-qt6:1.0}"
|
||||||
|
|
||||||
log_info() {
|
log_info() {
|
||||||
printf 'INFO: %s\n' "$*"
|
printf 'INFO: %s\n' "$*"
|
||||||
@@ -60,4 +62,16 @@ bash ./new_docker_build.sh \
|
|||||||
--build-number "${BUILD_NUMBER}" \
|
--build-number "${BUILD_NUMBER}" \
|
||||||
--build-tag "${BUILD_TAG}"
|
--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 ==="
|
log_info "=== Release Pipeline Complete ==="
|
||||||
Executable → Regular
+99
-30
@@ -9,7 +9,7 @@ set -euo pipefail
|
|||||||
# optionally runs the Jenkins builder to produce the release DEB packages.
|
# optionally runs the Jenkins builder to produce the release DEB packages.
|
||||||
#
|
#
|
||||||
# - Resolves MIGRATE_PIPELINE_ROOT (exported variable, .envrc, or derived
|
# - Resolves MIGRATE_PIPELINE_ROOT (exported variable, .envrc, or derived
|
||||||
# from the script location) for the workspace and external mounts
|
# from the script location = repo root) for the workspace mount
|
||||||
# - Uses a prebuilt Docker image with all build dependencies installed
|
# - Uses a prebuilt Docker image with all build dependencies installed
|
||||||
# (build it from ./Dockerfile via --build-prebuilt-image)
|
# (build it from ./Dockerfile via --build-prebuilt-image)
|
||||||
# - Optional deletion of the prebuilt Docker image via --delete-prebuilt-image
|
# - Optional deletion of the prebuilt Docker image via --delete-prebuilt-image
|
||||||
@@ -28,7 +28,7 @@ Builds the release validation scope inside the prebuilt Docker image:
|
|||||||
|
|
||||||
Options:
|
Options:
|
||||||
--docker-image IMAGE Docker image name to use/build/delete
|
--docker-image IMAGE Docker image name to use/build/delete
|
||||||
(default: legatus-qt6-prebuilt:latest)
|
(default: legatus-qt6:1.0)
|
||||||
--build-prebuilt-image Build the prebuilt Docker image (from ./Dockerfile)
|
--build-prebuilt-image Build the prebuilt Docker image (from ./Dockerfile)
|
||||||
and exit. To run the build with it, run the script
|
and exit. To run the build with it, run the script
|
||||||
again with --docker-image
|
again with --docker-image
|
||||||
@@ -43,6 +43,13 @@ Package production options (RPM/DEB):
|
|||||||
--build-number NUM Build number for package (default: 1)
|
--build-number NUM Build number for package (default: 1)
|
||||||
--build-tag TAG Build tag for package (default: manual-build)
|
--build-tag TAG Build tag for package (default: manual-build)
|
||||||
|
|
||||||
|
Coverage options (lcov):
|
||||||
|
--run-coverage Build the release scope with -O0 --coverage, run ctest
|
||||||
|
and collect an lcov coverage report (mutually
|
||||||
|
exclusive with --run-jenkins-builder)
|
||||||
|
--coverage-output-dir DIR Directory to mount for coverage output
|
||||||
|
(default: ./coverage-out)
|
||||||
|
|
||||||
Environment variable overrides:
|
Environment variable overrides:
|
||||||
BUILD_PREBUILT_IMAGE=ON|OFF
|
BUILD_PREBUILT_IMAGE=ON|OFF
|
||||||
DELETE_PREBUILT_IMAGE=ON|OFF
|
DELETE_PREBUILT_IMAGE=ON|OFF
|
||||||
@@ -54,11 +61,13 @@ Environment variable overrides:
|
|||||||
GUEZ_MODE=ON|OFF
|
GUEZ_MODE=ON|OFF
|
||||||
BUILD_NUMBER=<num>
|
BUILD_NUMBER=<num>
|
||||||
BUILD_TAG=<tag>
|
BUILD_TAG=<tag>
|
||||||
|
RUN_COVERAGE=ON|OFF
|
||||||
|
COVERAGE_OUTPUT_DIR=<dir>
|
||||||
|
|
||||||
MIGRATE_PIPELINE_ROOT resolution (highest precedence first):
|
MIGRATE_PIPELINE_ROOT resolution (highest precedence first):
|
||||||
1. exported MIGRATE_PIPELINE_ROOT (e.g. from a Jenkinsfile)
|
1. exported MIGRATE_PIPELINE_ROOT (e.g. from a Jenkinsfile)
|
||||||
2. MIGRATE_PIPELINE_ROOT set by .envrc in this directory
|
2. MIGRATE_PIPELINE_ROOT set by .envrc in this directory
|
||||||
3. derived from the script location (three levels up)
|
3. derived from the script location (the DLBO Qt6 repo root)
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
./new_docker_build.sh --build-prebuilt-image --docker-image legatus-qt6:1.0
|
./new_docker_build.sh --build-prebuilt-image --docker-image legatus-qt6:1.0
|
||||||
@@ -67,6 +76,9 @@ Examples:
|
|||||||
./new_docker_build.sh --docker-image legatus-qt6:1.0 \
|
./new_docker_build.sh --docker-image legatus-qt6:1.0 \
|
||||||
--run-jenkins-builder \
|
--run-jenkins-builder \
|
||||||
--package-output-dir "${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/"
|
--package-output-dir "${WORKSPACE}/rpms/${PROJECT}/${OS_VERSION}/"
|
||||||
|
./new_docker_build.sh --docker-image legatus-qt6:1.0 \
|
||||||
|
--run-coverage \
|
||||||
|
--coverage-output-dir "${WORKSPACE}/coverage/${PROJECT}/${OS_VERSION}/"
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,6 +196,8 @@ APT_PACKAGES=(
|
|||||||
postgresql-server-dev-all
|
postgresql-server-dev-all
|
||||||
git
|
git
|
||||||
python3-pip
|
python3-pip
|
||||||
|
# Code coverage (genhtml ships in the same package)
|
||||||
|
lcov
|
||||||
# Packaging tools for RPM/DEB build
|
# Packaging tools for RPM/DEB build
|
||||||
rpm
|
rpm
|
||||||
debhelper
|
debhelper
|
||||||
@@ -262,20 +276,12 @@ build_prebuilt_image() {
|
|||||||
|
|
||||||
require_command docker
|
require_command docker
|
||||||
|
|
||||||
# MIGRATE_PIPELINE_ROOT resolution (highest precedence first):
|
|
||||||
# 1. exported environment variable (e.g. from a Jenkinsfile)
|
|
||||||
# 2. .envrc in this directory (if present)
|
|
||||||
# 3. derived from this script's location - the script always lives at
|
|
||||||
# <root>/qt-migration-legatus/qt6-after/qt6-migrated-legatus, so the
|
|
||||||
# pipeline root is three levels up. This makes the script work in a
|
|
||||||
# fresh Jenkins checkout with no environment setup at all.
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
MIGRATE_PIPELINE_ROOT_DEFAULT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
|
MIGRATE_PIPELINE_ROOT_DEFAULT="${SCRIPT_DIR}"
|
||||||
PIPELINE_ROOT_EXPORTED="${MIGRATE_PIPELINE_ROOT:-}"
|
PIPELINE_ROOT_EXPORTED="${MIGRATE_PIPELINE_ROOT:-}"
|
||||||
|
|
||||||
if [[ -f ".envrc" ]]; then
|
if [[ -f ".envrc" ]]; then
|
||||||
set -a
|
set -a
|
||||||
# shellcheck disable=SC1091
|
|
||||||
source ".envrc"
|
source ".envrc"
|
||||||
set +a
|
set +a
|
||||||
fi
|
fi
|
||||||
@@ -295,6 +301,9 @@ DELETE_PREBUILT_IMAGE="${DELETE_PREBUILT_IMAGE:-OFF}"
|
|||||||
# Jenkins builder options for RPM/DEB package production
|
# Jenkins builder options for RPM/DEB package production
|
||||||
RUN_JENKINS_BUILDER="${RUN_JENKINS_BUILDER:-OFF}"
|
RUN_JENKINS_BUILDER="${RUN_JENKINS_BUILDER:-OFF}"
|
||||||
PACKAGE_OUTPUT_DIR="${PACKAGE_OUTPUT_DIR:-./packages-out}"
|
PACKAGE_OUTPUT_DIR="${PACKAGE_OUTPUT_DIR:-./packages-out}"
|
||||||
|
# Code coverage (lcov)
|
||||||
|
RUN_COVERAGE="${RUN_COVERAGE:-OFF}"
|
||||||
|
COVERAGE_OUTPUT_DIR="${COVERAGE_OUTPUT_DIR:-./coverage-out}"
|
||||||
LTS_VERSION="${LTS_VERSION:-1.0}"
|
LTS_VERSION="${LTS_VERSION:-1.0}"
|
||||||
PROJECT="${PROJECT:-guez}"
|
PROJECT="${PROJECT:-guez}"
|
||||||
GUEZ_MODE="${GUEZ_MODE:-ON}"
|
GUEZ_MODE="${GUEZ_MODE:-ON}"
|
||||||
@@ -327,6 +336,14 @@ while [[ $# -gt 0 ]]; do
|
|||||||
[[ $# -gt 0 ]] || die "--package-output-dir requires a directory path"
|
[[ $# -gt 0 ]] || die "--package-output-dir requires a directory path"
|
||||||
PACKAGE_OUTPUT_DIR="$1"
|
PACKAGE_OUTPUT_DIR="$1"
|
||||||
;;
|
;;
|
||||||
|
--run-coverage)
|
||||||
|
RUN_COVERAGE=ON
|
||||||
|
;;
|
||||||
|
--coverage-output-dir)
|
||||||
|
shift
|
||||||
|
[[ $# -gt 0 ]] || die "--coverage-output-dir requires a directory path"
|
||||||
|
COVERAGE_OUTPUT_DIR="$1"
|
||||||
|
;;
|
||||||
--lts-version)
|
--lts-version)
|
||||||
shift
|
shift
|
||||||
[[ $# -gt 0 ]] || die "--lts-version requires a version string"
|
[[ $# -gt 0 ]] || die "--lts-version requires a version string"
|
||||||
@@ -362,12 +379,17 @@ done
|
|||||||
BUILD_PREBUILT_IMAGE="$(normalize_on_off "$BUILD_PREBUILT_IMAGE" "BUILD_PREBUILT_IMAGE")"
|
BUILD_PREBUILT_IMAGE="$(normalize_on_off "$BUILD_PREBUILT_IMAGE" "BUILD_PREBUILT_IMAGE")"
|
||||||
DELETE_PREBUILT_IMAGE="$(normalize_on_off "$DELETE_PREBUILT_IMAGE" "DELETE_PREBUILT_IMAGE")"
|
DELETE_PREBUILT_IMAGE="$(normalize_on_off "$DELETE_PREBUILT_IMAGE" "DELETE_PREBUILT_IMAGE")"
|
||||||
RUN_JENKINS_BUILDER="$(normalize_on_off "$RUN_JENKINS_BUILDER" "RUN_JENKINS_BUILDER")"
|
RUN_JENKINS_BUILDER="$(normalize_on_off "$RUN_JENKINS_BUILDER" "RUN_JENKINS_BUILDER")"
|
||||||
|
RUN_COVERAGE="$(normalize_on_off "$RUN_COVERAGE" "RUN_COVERAGE")"
|
||||||
|
|
||||||
|
if [[ "${RUN_COVERAGE}" == "ON" && "${RUN_JENKINS_BUILDER}" == "ON" ]]; then
|
||||||
|
die "--run-coverage is mutually exclusive with --run-jenkins-builder"
|
||||||
|
fi
|
||||||
|
|
||||||
# Default for the Docker image name
|
# Default for the Docker image name
|
||||||
DOCKER_IMAGE="${DOCKER_IMAGE:-legatus-qt6-prebuilt:latest}"
|
DOCKER_IMAGE="${DOCKER_IMAGE:-legatus-qt6:1.0}"
|
||||||
|
|
||||||
# Export variables for Docker container
|
# Export variables for Docker container
|
||||||
export RELEASE_BUILD RUN_CTEST BUILD_PREBUILT_IMAGE DELETE_PREBUILT_IMAGE DOCKER_IMAGE RUN_JENKINS_BUILDER PACKAGE_OUTPUT_DIR LTS_VERSION PROJECT GUEZ_MODE BUILD_NUMBER BUILD_TAG
|
export RELEASE_BUILD RUN_CTEST BUILD_PREBUILT_IMAGE DELETE_PREBUILT_IMAGE DOCKER_IMAGE RUN_JENKINS_BUILDER PACKAGE_OUTPUT_DIR RUN_COVERAGE COVERAGE_OUTPUT_DIR LTS_VERSION PROJECT GUEZ_MODE BUILD_NUMBER BUILD_TAG
|
||||||
|
|
||||||
require_non_empty "${DOCKER_IMAGE}" "DOCKER_IMAGE"
|
require_non_empty "${DOCKER_IMAGE}" "DOCKER_IMAGE"
|
||||||
|
|
||||||
@@ -380,7 +402,7 @@ require_non_empty "${MIGRATE_PIPELINE_ROOT:-}" "MIGRATE_PIPELINE_ROOT"
|
|||||||
require_directory "${MIGRATE_PIPELINE_ROOT}" "MIGRATE_PIPELINE_ROOT"
|
require_directory "${MIGRATE_PIPELINE_ROOT}" "MIGRATE_PIPELINE_ROOT"
|
||||||
|
|
||||||
WORKSPACE_ROOT_HOST="${MIGRATE_PIPELINE_ROOT}"
|
WORKSPACE_ROOT_HOST="${MIGRATE_PIPELINE_ROOT}"
|
||||||
PROJECT_DIR_HOST="${WORKSPACE_ROOT_HOST}/qt-migration-legatus/qt6-after/qt6-migrated-legatus"
|
PROJECT_DIR_HOST="${WORKSPACE_ROOT_HOST}"
|
||||||
|
|
||||||
require_directory "${PROJECT_DIR_HOST}" "Project directory"
|
require_directory "${PROJECT_DIR_HOST}" "Project directory"
|
||||||
|
|
||||||
@@ -391,6 +413,8 @@ log_info "DELETE_PREBUILT_IMAGE=${DELETE_PREBUILT_IMAGE}"
|
|||||||
log_info "DOCKER_IMAGE=${DOCKER_IMAGE}"
|
log_info "DOCKER_IMAGE=${DOCKER_IMAGE}"
|
||||||
log_info "RUN_JENKINS_BUILDER=${RUN_JENKINS_BUILDER}"
|
log_info "RUN_JENKINS_BUILDER=${RUN_JENKINS_BUILDER}"
|
||||||
log_info "PACKAGE_OUTPUT_DIR=${PACKAGE_OUTPUT_DIR}"
|
log_info "PACKAGE_OUTPUT_DIR=${PACKAGE_OUTPUT_DIR}"
|
||||||
|
log_info "RUN_COVERAGE=${RUN_COVERAGE}"
|
||||||
|
log_info "COVERAGE_OUTPUT_DIR=${COVERAGE_OUTPUT_DIR}"
|
||||||
log_info "LTS_VERSION=${LTS_VERSION}"
|
log_info "LTS_VERSION=${LTS_VERSION}"
|
||||||
log_info "PROJECT=${PROJECT}"
|
log_info "PROJECT=${PROJECT}"
|
||||||
log_info "GUEZ_MODE=${GUEZ_MODE}"
|
log_info "GUEZ_MODE=${GUEZ_MODE}"
|
||||||
@@ -426,6 +450,7 @@ RELEASE_BUILD="${RELEASE_BUILD:-ON}"
|
|||||||
RUN_CTEST="${RUN_CTEST:-ON}"
|
RUN_CTEST="${RUN_CTEST:-ON}"
|
||||||
# Packaging variables
|
# Packaging variables
|
||||||
RUN_JENKINS_BUILDER="${RUN_JENKINS_BUILDER:-OFF}"
|
RUN_JENKINS_BUILDER="${RUN_JENKINS_BUILDER:-OFF}"
|
||||||
|
RUN_COVERAGE="${RUN_COVERAGE:-OFF}"
|
||||||
LTS_VERSION="${LTS_VERSION:-1.0}"
|
LTS_VERSION="${LTS_VERSION:-1.0}"
|
||||||
PROJECT="${PROJECT:-guez}"
|
PROJECT="${PROJECT:-guez}"
|
||||||
GUEZ_MODE="${GUEZ_MODE:-ON}"
|
GUEZ_MODE="${GUEZ_MODE:-ON}"
|
||||||
@@ -449,20 +474,28 @@ log_info "Using prebuilt Docker image: all build dependencies are baked in"
|
|||||||
|
|
||||||
export QT_QPA_PLATFORM=offscreen
|
export QT_QPA_PLATFORM=offscreen
|
||||||
|
|
||||||
cd /workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus
|
cd /workspace
|
||||||
|
|
||||||
rm -rf build4
|
rm -rf build4
|
||||||
mkdir -p build4
|
mkdir -p build4
|
||||||
cd build4
|
cd build4
|
||||||
|
|
||||||
# RELEASE_BUILD=ON selects the release scope (TetraIF, Z/src, Lts/Common +
|
COV_CMAKE_ARGS=()
|
||||||
# TrainingAreaBase); all other BUILD_* flags are left at their CMake defaults.
|
if [[ "${RUN_COVERAGE}" == "ON" ]]; then
|
||||||
|
COV_CMAKE_ARGS=(
|
||||||
|
"-DCMAKE_C_FLAGS_RELEASE=-O0 -g --coverage -DNDEBUG -fPIC"
|
||||||
|
"-DCMAKE_CXX_FLAGS_RELEASE=-O0 -g --coverage -DNDEBUG -fPIC"
|
||||||
|
"-DCMAKE_EXE_LINKER_FLAGS=--coverage"
|
||||||
|
"-DCMAKE_SHARED_LINKER_FLAGS=--coverage"
|
||||||
|
)
|
||||||
|
fi
|
||||||
cmake .. \
|
cmake .. \
|
||||||
-DBUILD_TESTING=ON \
|
-DBUILD_TESTING=ON \
|
||||||
-DRELEASE_BUILD="${RELEASE_BUILD}" \
|
-DRELEASE_BUILD="${RELEASE_BUILD}" \
|
||||||
-DCMAKE_CXX_STANDARD=17 \
|
-DCMAKE_CXX_STANDARD=17 \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_PREFIX_PATH="${QT_BASE_DIR}/${QT_VERSION}/${QT_ARCH_DIR}:/usr/local"
|
-DCMAKE_PREFIX_PATH="${QT_BASE_DIR}/${QT_VERSION}/${QT_ARCH_DIR}:/usr/local" \
|
||||||
|
"${COV_CMAKE_ARGS[@]}"
|
||||||
|
|
||||||
read -r -a RELEASE_TARGETS_ARRAY <<< "${RELEASE_BUILD_TARGETS}"
|
read -r -a RELEASE_TARGETS_ARRAY <<< "${RELEASE_BUILD_TARGETS}"
|
||||||
|
|
||||||
@@ -479,22 +512,61 @@ else
|
|||||||
log_info "Skipping CTest"
|
log_info "Skipping CTest"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "${RUN_COVERAGE}" == "ON" ]]; then
|
||||||
|
log_info "=== Code coverage (lcov) ==="
|
||||||
|
COVOUT=/workspace/coverage-out
|
||||||
|
SRCROOT=/workspace
|
||||||
|
mkdir -p "${COVOUT}"
|
||||||
|
|
||||||
|
COV_IGNORE=(--ignore-errors mismatch,inconsistent,unused)
|
||||||
|
lcov --capture --directory . --external "${COV_IGNORE[@]}" \
|
||||||
|
--rc branch_coverage=1 \
|
||||||
|
--output-file "${COVOUT}/raw.info"
|
||||||
|
lcov --extract "${COVOUT}/raw.info" \
|
||||||
|
"${SRCROOT}/TetraIF/*" \
|
||||||
|
"${SRCROOT}/Z/src/*" \
|
||||||
|
"${SRCROOT}/Lts/Common/*" \
|
||||||
|
"${SRCROOT}/Lts/Proxies/TrainingAreaBase/*" \
|
||||||
|
"${COV_IGNORE[@]}" \
|
||||||
|
--rc branch_coverage=1 \
|
||||||
|
--output-file "${COVOUT}/scoped.info"
|
||||||
|
lcov --remove "${COVOUT}/scoped.info" \
|
||||||
|
"*/unit-test/*" \
|
||||||
|
"*CommonUnitTestsPlaceholder*" \
|
||||||
|
"*/UnitTests/*" \
|
||||||
|
"*/tests/*" \
|
||||||
|
"*/test_*" \
|
||||||
|
"*_test.cpp" \
|
||||||
|
"*_test.h" \
|
||||||
|
"*_unit_test*" \
|
||||||
|
"${COV_IGNORE[@]}" \
|
||||||
|
--rc branch_coverage=1 \
|
||||||
|
--output-file "${COVOUT}/coverage.info"
|
||||||
|
lcov --summary "${COVOUT}/coverage.info" "${COV_IGNORE[@]}" --rc branch_coverage=1 \
|
||||||
|
> "${COVOUT}/coverage_summary.txt"
|
||||||
|
genhtml "${COVOUT}/coverage.info" \
|
||||||
|
--output-directory "${COVOUT}/html" \
|
||||||
|
"${COV_IGNORE[@]}" \
|
||||||
|
--branch-coverage --legend \
|
||||||
|
--rc branch_coverage=1
|
||||||
|
log_info "Coverage report written to ${COVOUT} (host: ${COVERAGE_OUTPUT_DIR})"
|
||||||
|
cat "${COVOUT}/coverage_summary.txt"
|
||||||
|
fi
|
||||||
|
|
||||||
# DEB package production with the in-tree rpmbuild script
|
# DEB package production with the in-tree rpmbuild script
|
||||||
if [[ "${RUN_JENKINS_BUILDER}" == "ON" ]]; then
|
if [[ "${RUN_JENKINS_BUILDER}" == "ON" ]]; then
|
||||||
log_info "=== DEB Package Production (in-tree rpmbuild) ==="
|
log_info "=== DEB Package Production (in-tree rpmbuild) ==="
|
||||||
|
|
||||||
OS_VERSION=$(cat /etc/os-release | grep "^VERSION_ID=" | cut -d'"' -f2)
|
OS_VERSION=$(cat /etc/os-release | grep "^VERSION_ID=" | cut -d'"' -f2)
|
||||||
STAGE_DIR=/workspace/deb_stage
|
STAGE_DIR=/workspace/deb_stage
|
||||||
STAGED_SOURCE_DIR="${STAGE_DIR}/qt-migration-legatus/qt6-after/qt6-migrated-legatus"
|
STAGED_SOURCE_DIR="${STAGE_DIR}"
|
||||||
|
|
||||||
# Stage the workspace as a clean copy. The workspace itself is NEVER
|
|
||||||
# deleted (it contains git-managed sources); only the staging
|
|
||||||
# subdirectory is removed.
|
|
||||||
log_info "Staging workspace to ${STAGE_DIR}"
|
log_info "Staging workspace to ${STAGE_DIR}"
|
||||||
rm -rf "${STAGE_DIR}"
|
rm -rf "${STAGE_DIR}"
|
||||||
mkdir -p "${STAGE_DIR}"
|
mkdir -p "${STAGE_DIR}"
|
||||||
tar --exclude='./rpms' --exclude='./.git' --exclude='./build' \
|
tar --exclude='./rpms' --exclude='./.git' --exclude='./build' \
|
||||||
--exclude='./deb_build_tmp' --exclude='./deb_stage' --exclude='./packages-out' \
|
--exclude='./deb_build_tmp' --exclude='./deb_stage' --exclude='./packages-out' \
|
||||||
|
--exclude='./legatus-qt6_1.0.tar.gz' \
|
||||||
-cf - -C /workspace . | tar -xf - -C "${STAGE_DIR}"
|
-cf - -C /workspace . | tar -xf - -C "${STAGE_DIR}"
|
||||||
|
|
||||||
if [[ ! -f "${STAGED_SOURCE_DIR}/CMakeLists.txt" || ! -f "${STAGED_SOURCE_DIR}/rpmbuild/make_rpm_ubuntu26.py" ]]; then
|
if [[ ! -f "${STAGED_SOURCE_DIR}/CMakeLists.txt" || ! -f "${STAGED_SOURCE_DIR}/rpmbuild/make_rpm_ubuntu26.py" ]]; then
|
||||||
@@ -525,12 +597,7 @@ if [[ "${RUN_JENKINS_BUILDER}" == "ON" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy produced DEB packages to the packages-out mount (host:
|
# Copy produced DEB packages to the packages-out
|
||||||
# ${PACKAGE_OUTPUT_DIR}, container: /workspace/packages-out) so they are
|
|
||||||
# available on the host after the container exits.
|
|
||||||
# make_rpm already writes to /workspace/rpms/... (the host workspace
|
|
||||||
# mount), so when the host's PACKAGE_OUTPUT_DIR is that same directory
|
|
||||||
# the packages are already in place - skip copying onto themselves.
|
|
||||||
DEST_DIR=/workspace/packages-out
|
DEST_DIR=/workspace/packages-out
|
||||||
mkdir -p "${DEST_DIR}"
|
mkdir -p "${DEST_DIR}"
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
@@ -559,6 +626,8 @@ docker run --rm \
|
|||||||
-e RELEASE_BUILD \
|
-e RELEASE_BUILD \
|
||||||
-e RUN_CTEST \
|
-e RUN_CTEST \
|
||||||
-e RUN_JENKINS_BUILDER \
|
-e RUN_JENKINS_BUILDER \
|
||||||
|
-e RUN_COVERAGE \
|
||||||
|
-e COVERAGE_OUTPUT_DIR \
|
||||||
-e PACKAGE_OUTPUT_DIR \
|
-e PACKAGE_OUTPUT_DIR \
|
||||||
-e LTS_VERSION \
|
-e LTS_VERSION \
|
||||||
-e PROJECT \
|
-e PROJECT \
|
||||||
@@ -571,8 +640,8 @@ docker run --rm \
|
|||||||
-e QT_BASE_DIR \
|
-e QT_BASE_DIR \
|
||||||
-e RELEASE_BUILD_TARGETS="${RELEASE_BUILD_TARGETS_STRING}" \
|
-e RELEASE_BUILD_TARGETS="${RELEASE_BUILD_TARGETS_STRING}" \
|
||||||
-v "${WORKSPACE_ROOT_HOST}:/workspace" \
|
-v "${WORKSPACE_ROOT_HOST}:/workspace" \
|
||||||
-v "${MIGRATE_PIPELINE_ROOT}/external:/workspace/external:ro" \
|
|
||||||
-v "${CONTAINER_SCRIPT_HOST}:/tmp/run-build-inside-container.sh:ro" \
|
-v "${CONTAINER_SCRIPT_HOST}:/tmp/run-build-inside-container.sh:ro" \
|
||||||
-v "${PACKAGE_OUTPUT_DIR}:/workspace/packages-out" \
|
-v "${PACKAGE_OUTPUT_DIR}:/workspace/packages-out" \
|
||||||
|
-v "${COVERAGE_OUTPUT_DIR}:/workspace/coverage-out" \
|
||||||
"${DOCKER_IMAGE}" \
|
"${DOCKER_IMAGE}" \
|
||||||
bash /tmp/run-build-inside-container.sh
|
bash /tmp/run-build-inside-container.sh
|
||||||
+631
@@ -0,0 +1,631 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
# Build helper for qt-migrated-legatus inside Docker - RELEASE 2 VERSION
|
||||||
|
#
|
||||||
|
# Release 2 Scope:
|
||||||
|
# - AP3: Shared libraries (LtsUtils, Widgets, Session, Krypto, PluginManager)
|
||||||
|
# - AP4: DDS middleware (Core, DDSConnector, Routing, QosProfile, RTI layer)
|
||||||
|
# - AP9: Tools and translations (DdsView, LogViewer, SqlBrowser, generators, lupdate)
|
||||||
|
#
|
||||||
|
# This script is derived from new_docker_build.sh but focused on Release 2 targets only.
|
||||||
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<'EOF'
|
||||||
|
Usage: ./new_docker_build_release2.sh [options]
|
||||||
|
|
||||||
|
Build groups (Release 2 scope):
|
||||||
|
--group1 / --no-group1 Enable/disable DDS core libraries build (AP4)
|
||||||
|
--group3 / --no-group3 Enable/disable Lts services build (AP3)
|
||||||
|
--group5 / --no-group5 Enable/disable Lts/Viewer module targets and tests (AP9)
|
||||||
|
--group6 / --no-group6 Enable/disable LTS Tools - generators and lupdate (AP9)
|
||||||
|
|
||||||
|
Test execution:
|
||||||
|
--no-ctest Skip ctest execution
|
||||||
|
--tests-only Run only ctest, skip all make build groups
|
||||||
|
|
||||||
|
Prebuilt Docker image usage:
|
||||||
|
--use-prebuilt-image Use a Docker image with dependencies already installed
|
||||||
|
--no-prebuilt-image Use base image and run apt-get install inside the container
|
||||||
|
--docker-image IMAGE Docker image name to use/build/delete
|
||||||
|
--cmake_build_flags FLAGS Extra CMake flags passed to the in-container configure
|
||||||
|
(space-separated -D flags)
|
||||||
|
|
||||||
|
Package production options (DEB):
|
||||||
|
--run-jenkins-builder Build the release DEB packages inside the container
|
||||||
|
using the in-tree rpmbuild/make_rpm_ubuntu26.py
|
||||||
|
--package-output-dir DIR Directory to mount for package output (default: ./packages-out)
|
||||||
|
--lts-version VERSION LTS version for package (default: 1.0)
|
||||||
|
--project NAME Project name for package (default: guez)
|
||||||
|
--build-number NUM Build number for package (default: 1)
|
||||||
|
--build-tag TAG Build tag for package (default: manual-build)
|
||||||
|
|
||||||
|
Coverage options (lcov):
|
||||||
|
--run-coverage Build with -O0 --coverage, run ctest and collect lcov
|
||||||
|
--coverage-output-dir DIR Directory to mount for coverage output (default: ./coverage-out)
|
||||||
|
|
||||||
|
Docker mount configuration:
|
||||||
|
--docker-mount-root PATH Container-side mount root path (default: /repo)
|
||||||
|
Changes where host directories are mounted in container
|
||||||
|
|
||||||
|
Environment variable overrides:
|
||||||
|
BUILD_GROUP1=ON|OFF DDS core libraries (AP4)
|
||||||
|
BUILD_GROUP3=ON|OFF Lts services (AP3)
|
||||||
|
BUILD_GROUP5=ON|OFF Viewer module (AP9)
|
||||||
|
BUILD_GROUP6=ON|OFF Tools/generators (AP9)
|
||||||
|
RUN_CTEST=ON|OFF
|
||||||
|
TESTS_ONLY=ON|OFF
|
||||||
|
USE_PREBUILT_IMAGE=ON|OFF
|
||||||
|
RUN_JENKINS_BUILDER=ON|OFF
|
||||||
|
PACKAGE_OUTPUT_DIR=<dir>
|
||||||
|
LTS_VERSION=<version>
|
||||||
|
PROJECT=<name>
|
||||||
|
BUILD_NUMBER=<num>
|
||||||
|
BUILD_TAG=<tag>
|
||||||
|
RUN_COVERAGE=ON|OFF
|
||||||
|
COVERAGE_OUTPUT_DIR=<dir>
|
||||||
|
|
||||||
|
MIGRATE_PIPELINE_ROOT resolution (highest precedence first):
|
||||||
|
1. exported MIGRATE_PIPELINE_ROOT (e.g. from a Jenkinsfile)
|
||||||
|
2. MIGRATE_PIPELINE_ROOT set by .envrc in this directory
|
||||||
|
3. derived from the script location (the DLBO Qt6 repo root)
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
./new_docker_build_release2.sh --group1 --group3 --group5 --group6
|
||||||
|
BUILD_GROUP1=ON BUILD_GROUP3=ON ./new_docker_build_release2.sh
|
||||||
|
./new_docker_build_release2.sh --use-prebuilt-image --no-ctest
|
||||||
|
./new_docker_build_release2.sh --group3 --run-jenkins-builder \
|
||||||
|
--package-output-dir "${WORKSPACE}/rpms/guez/release2/"
|
||||||
|
./new_docker_build_release2.sh --group3 --run-coverage \
|
||||||
|
--coverage-output-dir "${WORKSPACE}/coverage/guez/release2/"
|
||||||
|
EOF
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
log_info() {
|
||||||
|
echo "[INFO] $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
log_error() {
|
||||||
|
printf "ERROR: %s\n" "$*" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
die() {
|
||||||
|
echo "[ERROR] $*" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Default values
|
||||||
|
BUILD_GROUP1="${BUILD_GROUP1:-ON}" # AP4: DDS
|
||||||
|
BUILD_GROUP3="${BUILD_GROUP3:-ON}" # AP3: Lts services
|
||||||
|
BUILD_GROUP5="${BUILD_GROUP5:-ON}" # AP9: Viewer
|
||||||
|
BUILD_GROUP6="${BUILD_GROUP6:-ON}" # AP9: Tools/generators
|
||||||
|
RUN_CTEST="${RUN_CTEST:-ON}"
|
||||||
|
TESTS_ONLY="${TESTS_ONLY:-OFF}"
|
||||||
|
USE_PREBUILT_IMAGE="${USE_PREBUILT_IMAGE:-OFF}"
|
||||||
|
DOCKER_IMAGE="${DOCKER_IMAGE:-qt6-migrated-legatus-release2}"
|
||||||
|
CMAKE_BUILD_FLAGS="${CMAKE_BUILD_FLAGS:-}"
|
||||||
|
DOCKER_MOUNT_ROOT="${DOCKER_MOUNT_ROOT:-/repo}"
|
||||||
|
export DOCKER_MOUNT_ROOT
|
||||||
|
|
||||||
|
# Jenkins builder options for DEB package production
|
||||||
|
RUN_JENKINS_BUILDER="${RUN_JENKINS_BUILDER:-OFF}"
|
||||||
|
PACKAGE_OUTPUT_DIR="${PACKAGE_OUTPUT_DIR:-./packages-out}"
|
||||||
|
LTS_VERSION="${LTS_VERSION:-1.0}"
|
||||||
|
PROJECT="${PROJECT:-guez}"
|
||||||
|
BUILD_NUMBER="${BUILD_NUMBER:-1}"
|
||||||
|
BUILD_TAG="${BUILD_TAG:-manual-build}"
|
||||||
|
|
||||||
|
# Code coverage (lcov)
|
||||||
|
RUN_COVERAGE="${RUN_COVERAGE:-OFF}"
|
||||||
|
COVERAGE_OUTPUT_DIR="${COVERAGE_OUTPUT_DIR:-./coverage-out}"
|
||||||
|
|
||||||
|
# Export variables for Docker container
|
||||||
|
export BUILD_GROUP1 BUILD_GROUP3 BUILD_GROUP5 BUILD_GROUP6 RUN_CTEST TESTS_ONLY USE_PREBUILT_IMAGE
|
||||||
|
export RUN_JENKINS_BUILDER PACKAGE_OUTPUT_DIR LTS_VERSION PROJECT BUILD_NUMBER BUILD_TAG
|
||||||
|
export RUN_COVERAGE COVERAGE_OUTPUT_DIR
|
||||||
|
|
||||||
|
# MIGRATE_PIPELINE_ROOT resolution (highest precedence first):
|
||||||
|
# 1. exported MIGRATE_PIPELINE_ROOT (e.g. from a Jenkinsfile)
|
||||||
|
# 2. MIGRATE_PIPELINE_ROOT set by .envrc in this directory
|
||||||
|
# 3. derived from the script location (the DLBO Qt6 repo root)
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
MIGRATE_PIPELINE_ROOT_DEFAULT="${SCRIPT_DIR}"
|
||||||
|
PIPELINE_ROOT_EXPORTED="${MIGRATE_PIPELINE_ROOT:-}"
|
||||||
|
|
||||||
|
if [[ -f ".envrc" ]]; then
|
||||||
|
set -a
|
||||||
|
source ".envrc"
|
||||||
|
set +a
|
||||||
|
fi
|
||||||
|
|
||||||
|
# An explicitly exported MIGRATE_PIPELINE_ROOT (Jenkinsfile) wins over .envrc
|
||||||
|
if [[ -n "${PIPELINE_ROOT_EXPORTED}" ]]; then
|
||||||
|
MIGRATE_PIPELINE_ROOT="${PIPELINE_ROOT_EXPORTED}"
|
||||||
|
else
|
||||||
|
MIGRATE_PIPELINE_ROOT="${MIGRATE_PIPELINE_ROOT:-${MIGRATE_PIPELINE_ROOT_DEFAULT}}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export MIGRATE_PIPELINE_ROOT
|
||||||
|
|
||||||
|
# Parse arguments
|
||||||
|
while [[ $# -gt 0 ]]; do
|
||||||
|
case "$1" in
|
||||||
|
--group1)
|
||||||
|
BUILD_GROUP1="ON"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--no-group1)
|
||||||
|
BUILD_GROUP1="OFF"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--group3)
|
||||||
|
BUILD_GROUP3="ON"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--no-group3)
|
||||||
|
BUILD_GROUP3="OFF"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--group5)
|
||||||
|
BUILD_GROUP5="ON"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--no-group5)
|
||||||
|
BUILD_GROUP5="OFF"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--group6)
|
||||||
|
BUILD_GROUP6="ON"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--no-group6)
|
||||||
|
BUILD_GROUP6="OFF"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--no-ctest)
|
||||||
|
RUN_CTEST="OFF"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--tests-only)
|
||||||
|
TESTS_ONLY="ON"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--use-prebuilt-image)
|
||||||
|
USE_PREBUILT_IMAGE="ON"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--no-prebuilt-image)
|
||||||
|
USE_PREBUILT_IMAGE="OFF"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--docker-image)
|
||||||
|
DOCKER_IMAGE="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
--cmake_build_flags)
|
||||||
|
CMAKE_BUILD_FLAGS="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
--docker-mount-root)
|
||||||
|
DOCKER_MOUNT_ROOT="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
--run-jenkins-builder)
|
||||||
|
RUN_JENKINS_BUILDER="ON"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--package-output-dir)
|
||||||
|
PACKAGE_OUTPUT_DIR="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
--lts-version)
|
||||||
|
LTS_VERSION="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
--project)
|
||||||
|
PROJECT="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
--build-number)
|
||||||
|
BUILD_NUMBER="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
--build-tag)
|
||||||
|
BUILD_TAG="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
--run-coverage)
|
||||||
|
RUN_COVERAGE="ON"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--coverage-output-dir)
|
||||||
|
COVERAGE_OUTPUT_DIR="$2"
|
||||||
|
shift 2
|
||||||
|
;;
|
||||||
|
-h|--help)
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
die "Unknown option: $1"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# Validate mutually exclusive options
|
||||||
|
if [[ "${RUN_JENKINS_BUILDER}" == "ON" ]] && [[ "${RUN_COVERAGE}" == "ON" ]]; then
|
||||||
|
die "Error: --run-jenkins-builder and --run-coverage are mutually exclusive"
|
||||||
|
fi
|
||||||
|
|
||||||
|
require_command() {
|
||||||
|
if ! command -v "$1" &> /dev/null; then
|
||||||
|
die "Required command not found: $1"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
require_command docker
|
||||||
|
|
||||||
|
# Validate environment
|
||||||
|
if [[ ! -f ".envrc" ]]; then
|
||||||
|
die ".envrc not found in current directory. Please create .envrc with required environment variables (e.g., MIGRATE_PIPELINE_ROOT)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -a
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
source ".envrc"
|
||||||
|
set +a
|
||||||
|
|
||||||
|
if [[ -z "${MIGRATE_PIPELINE_ROOT:-}" ]]; then
|
||||||
|
die "MIGRATE_PIPELINE_ROOT is not set in .envrc"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ ! -d "${MIGRATE_PIPELINE_ROOT}" ]]; then
|
||||||
|
die "MIGRATE_PIPELINE_ROOT directory does not exist: ${MIGRATE_PIPELINE_ROOT}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Validate rti_license.dat exists (required for DDS builds)
|
||||||
|
if [[ "${BUILD_GROUP1}" == "ON" ]] && [[ ! -f "${MIGRATE_PIPELINE_ROOT}/rti_license.dat" ]]; then
|
||||||
|
die "rti_license.dat not found in MIGRATE_PIPELINE_ROOT. Required for DDS builds."
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_info "=== Release 2 Build Configuration ==="
|
||||||
|
log_info "BUILD_GROUP1 (DDS/AP4): ${BUILD_GROUP1}"
|
||||||
|
log_info "BUILD_GROUP3 (Lts/AP3): ${BUILD_GROUP3}"
|
||||||
|
log_info "BUILD_GROUP5 (Viewer/AP9): ${BUILD_GROUP5}"
|
||||||
|
log_info "BUILD_GROUP6 (Tools/AP9): ${BUILD_GROUP6}"
|
||||||
|
log_info "RUN_CTEST: ${RUN_CTEST}"
|
||||||
|
log_info "TESTS_ONLY: ${TESTS_ONLY}"
|
||||||
|
log_info "USE_PREBUILT_IMAGE: ${USE_PREBUILT_IMAGE}"
|
||||||
|
log_info "DOCKER_IMAGE: ${DOCKER_IMAGE}"
|
||||||
|
log_info "DOCKER_MOUNT_ROOT: ${DOCKER_MOUNT_ROOT}"
|
||||||
|
log_info "CMAKE_BUILD_FLAGS: ${CMAKE_BUILD_FLAGS:-none}"
|
||||||
|
log_info "======================================"
|
||||||
|
# Build prebuilt image if requested
|
||||||
|
if [[ "${USE_PREBUILT_IMAGE}" == "ON" ]]; then
|
||||||
|
if ! docker image inspect "${DOCKER_IMAGE}" &> /dev/null; then
|
||||||
|
log_info "Prebuilt image ${DOCKER_IMAGE} not found. Building it now..."
|
||||||
|
|
||||||
|
# Create temporary directory for Dockerfile
|
||||||
|
tmp_dir="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "${tmp_dir}"' EXIT
|
||||||
|
|
||||||
|
cat > "${tmp_dir}/Dockerfile" <<'DOCKERFILE'
|
||||||
|
FROM ubuntu:26.04
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN apt-get update -qq && \
|
||||||
|
apt-get install -y -qq \
|
||||||
|
build-essential \
|
||||||
|
cmake \
|
||||||
|
ninja-build \
|
||||||
|
git \
|
||||||
|
python3-pip \
|
||||||
|
libboost-dev \
|
||||||
|
libkf6texttemplate-dev \
|
||||||
|
libgtest-dev \
|
||||||
|
libgmock-dev \
|
||||||
|
libpq-dev \
|
||||||
|
postgresql-server-dev-all \
|
||||||
|
libvlc-dev \
|
||||||
|
vlc-plugin-base \
|
||||||
|
libssl-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
libxerces-c-dev \
|
||||||
|
&& \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install Qt6 packages via aqtinstall
|
||||||
|
RUN pip3 install --break-system-packages --quiet aqtinstall && \
|
||||||
|
aqt install-qt linux desktop 6.10.2 linux_gcc_64 \
|
||||||
|
-m qtmultimedia qtserialport qtimageformats qtwebsockets qtwebengine \
|
||||||
|
qtpdf qtwebview qt5compat qtwebchannel qtpositioning qtlocation qtsensors \
|
||||||
|
--outputdir /opt/Qt && \
|
||||||
|
rm -rf /root/.cache/Aqt
|
||||||
|
|
||||||
|
# Install KDReports from source
|
||||||
|
RUN git clone --depth 1 https://github.com/KDAB/KDReports.git /tmp/KDReports && \
|
||||||
|
cd /tmp/KDReports && \
|
||||||
|
mkdir build && cd build && \
|
||||||
|
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_PREFIX_PATH=/opt/Qt .. && \
|
||||||
|
make -j$(nproc) && \
|
||||||
|
make install && \
|
||||||
|
cd / && rm -rf /tmp/KDReports
|
||||||
|
|
||||||
|
# Create symlink for KDReports headers
|
||||||
|
RUN ln -sfn KDReports-qt6 /usr/local/include/KDReports
|
||||||
|
|
||||||
|
CMD ["/bin/bash"]
|
||||||
|
DOCKERFILE
|
||||||
|
|
||||||
|
docker build -t "${DOCKER_IMAGE}" "${tmp_dir}"
|
||||||
|
log_info "Prebuilt image created: ${DOCKER_IMAGE}"
|
||||||
|
else
|
||||||
|
log_info "Prebuilt image already exists: ${DOCKER_IMAGE}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Prepare Docker run command
|
||||||
|
DOCKER_RUN_ARGS=(
|
||||||
|
--rm
|
||||||
|
-e MIGRATE_PIPELINE_ROOT
|
||||||
|
-e DOCKER_MOUNT_ROOT="${DOCKER_MOUNT_ROOT}"
|
||||||
|
-e BUILD_GROUP1="${BUILD_GROUP1}"
|
||||||
|
-e BUILD_GROUP3="${BUILD_GROUP3}"
|
||||||
|
-e BUILD_GROUP5="${BUILD_GROUP5}"
|
||||||
|
-e BUILD_GROUP6="${BUILD_GROUP6}"
|
||||||
|
-e RUN_CTEST="${RUN_CTEST}"
|
||||||
|
-e TESTS_ONLY="${TESTS_ONLY}"
|
||||||
|
-e RUN_JENKINS_BUILDER="${RUN_JENKINS_BUILDER}"
|
||||||
|
-e PACKAGE_OUTPUT_DIR="${PACKAGE_OUTPUT_DIR}"
|
||||||
|
-e LTS_VERSION="${LTS_VERSION}"
|
||||||
|
-e PROJECT="${PROJECT}"
|
||||||
|
-e BUILD_NUMBER="${BUILD_NUMBER}"
|
||||||
|
-e BUILD_TAG="${BUILD_TAG}"
|
||||||
|
-e RUN_COVERAGE="${RUN_COVERAGE}"
|
||||||
|
-e COVERAGE_OUTPUT_DIR="${COVERAGE_OUTPUT_DIR}"
|
||||||
|
-v "${MIGRATE_PIPELINE_ROOT}:${DOCKER_MOUNT_ROOT}"
|
||||||
|
-w "${DOCKER_MOUNT_ROOT}/qt-migration-legatus/qt6-after/qt6-migrated-legatus"
|
||||||
|
)
|
||||||
|
|
||||||
|
if [[ "${USE_PREBUILT_IMAGE}" == "ON" ]]; then
|
||||||
|
DOCKER_RUN_ARGS+=("${DOCKER_IMAGE}")
|
||||||
|
else
|
||||||
|
DOCKER_RUN_ARGS+=("ubuntu:26.04")
|
||||||
|
fi
|
||||||
|
|
||||||
|
# When not using prebuilt image, we need to install dependencies first
|
||||||
|
if [[ "${USE_PREBUILT_IMAGE}" == "OFF" ]]; then
|
||||||
|
# Prepend dependency installation to the build command
|
||||||
|
INSTALL_DEPS='
|
||||||
|
set -e
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
apt-get update -qq && \
|
||||||
|
apt-get install -y -qq \
|
||||||
|
build-essential \
|
||||||
|
cmake \
|
||||||
|
ninja-build \
|
||||||
|
git \
|
||||||
|
python3-pip \
|
||||||
|
libboost-dev \
|
||||||
|
libkf6texttemplate-dev \
|
||||||
|
libgtest-dev \
|
||||||
|
libgmock-dev \
|
||||||
|
libpq-dev \
|
||||||
|
postgresql-server-dev-all \
|
||||||
|
libvlc-dev \
|
||||||
|
vlc-plugin-base \
|
||||||
|
libssl-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
libxerces-c-dev \
|
||||||
|
&& \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install Qt6 packages via aqtinstall
|
||||||
|
pip3 install --break-system-packages --quiet aqtinstall && \
|
||||||
|
aqt install-qt linux desktop 6.10.2 linux_gcc_64 \
|
||||||
|
-m qtmultimedia qtserialport qtimageformats qtwebsockets qtwebengine \
|
||||||
|
qtpdf qtwebview qt5compat qtwebchannel qtpositioning qtlocation qtsensors \
|
||||||
|
--outputdir /opt/Qt && \
|
||||||
|
rm -rf /root/.cache/Aqt
|
||||||
|
|
||||||
|
# Install KDReports from source
|
||||||
|
git clone --depth 1 https://github.com/KDAB/KDReports.git /tmp/KDReports && \
|
||||||
|
cd /tmp/KDReports && \
|
||||||
|
mkdir build && cd build && \
|
||||||
|
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_PREFIX_PATH=/opt/Qt .. && \
|
||||||
|
make -j$(nproc) && \
|
||||||
|
make install && \
|
||||||
|
cd / && rm -rf /tmp/KDReports
|
||||||
|
|
||||||
|
# Create symlink for KDReports headers
|
||||||
|
ln -sfn KDReports-qt6 /usr/local/include/KDReports
|
||||||
|
|
||||||
|
export PATH="/opt/Qt/6.10.2/gcc_64/bin:$PATH"
|
||||||
|
export CMAKE_PREFIX_PATH="/opt/Qt/6.10.2/gcc_64"
|
||||||
|
|
||||||
|
log_info() {
|
||||||
|
echo "[INFO] $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die() {
|
||||||
|
echo "[ERROR] $*" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
log_info "Dependencies installed successfully"
|
||||||
|
|
||||||
|
# Return to project directory
|
||||||
|
cd "${DOCKER_MOUNT_ROOT}/qt-migration-legatus/qt6-after/qt6-migrated-legatus"
|
||||||
|
'
|
||||||
|
else
|
||||||
|
INSTALL_DEPS=''
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Build command
|
||||||
|
DOCKER_RUN_ARGS+=(
|
||||||
|
/bin/bash
|
||||||
|
-c
|
||||||
|
'
|
||||||
|
set -e
|
||||||
|
|
||||||
|
log_info() {
|
||||||
|
echo "[INFO] $*"
|
||||||
|
}
|
||||||
|
|
||||||
|
log_error() {
|
||||||
|
printf "ERROR: %s\n" "$*" >&2
|
||||||
|
}
|
||||||
|
|
||||||
|
die() {
|
||||||
|
echo "[ERROR] $*" >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
'"${INSTALL_DEPS}"'
|
||||||
|
|
||||||
|
# Configure CMake
|
||||||
|
log_info "Configuring CMake..."
|
||||||
|
# Use unique build directory to avoid Docker mount caching issues
|
||||||
|
BUILD_DIR="build4_$(date +%Y%m%d_%H%M%S)_$$"
|
||||||
|
log_info "Using build directory: ${BUILD_DIR}"
|
||||||
|
rm -rf "${BUILD_DIR}"
|
||||||
|
mkdir -p "${BUILD_DIR}"
|
||||||
|
cmake -B "${BUILD_DIR}" \
|
||||||
|
-G Ninja \
|
||||||
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||||
|
-DCMAKE_PREFIX_PATH="/opt/Qt/6.10.2/gcc_64" \
|
||||||
|
-DCMAKE_CXX_FLAGS="-DRTI_LINUX -DRTI_UNIX" \
|
||||||
|
-DCMAKE_C_FLAGS="-DRTI_LINUX -DRTI_UNIX" \
|
||||||
|
-DBUILD_RTI=ON \
|
||||||
|
-DBUILD_GROUP1="${BUILD_GROUP1}" \
|
||||||
|
-DBUILD_GROUP3="${BUILD_GROUP3}" \
|
||||||
|
-DBUILD_GROUP5="${BUILD_GROUP5}" \
|
||||||
|
-DBUILD_GROUP6="${BUILD_GROUP6}" \
|
||||||
|
-DRUN_JENKINS_BUILDER="${RUN_JENKINS_BUILDER}" \
|
||||||
|
-DPACKAGE_OUTPUT_DIR="${PACKAGE_OUTPUT_DIR}" \
|
||||||
|
-DLTS_VERSION="${LTS_VERSION}" \
|
||||||
|
-DPROJECT="${PROJECT}" \
|
||||||
|
-DBUILD_NUMBER="${BUILD_NUMBER}" \
|
||||||
|
-DBUILD_TAG="${BUILD_TAG}" \
|
||||||
|
-DRUN_COVERAGE="${RUN_COVERAGE}" \
|
||||||
|
-DCOVERAGE_OUTPUT_DIR="${COVERAGE_OUTPUT_DIR}" \
|
||||||
|
'"${CMAKE_BUILD_FLAGS}"' \
|
||||||
|
.
|
||||||
|
|
||||||
|
# Build targets
|
||||||
|
log_info "Building Release 2 targets..."
|
||||||
|
|
||||||
|
# AP4: DDS middleware (Release 1 + Release 2 scope)
|
||||||
|
GROUP1_TARGETS=(ddscore ddsftccore ddsfts ddsgen ddsQoS ddsconnector)
|
||||||
|
# AP3: Shared libraries + TetraIF + Lts/Common + Tests (Release 1 + Release 2 scope)
|
||||||
|
GROUP3_TARGETS=(NGLLogger nglapplication nglcompression nglcoreapplication ngldb nglguiapplication nglsettings nglsingleapplication nglsinglecoreapplication ngltools ngltranslator nglwidgets qtsingleapplication qtsinglecoreapplication wms_json_ds tcpserver LtsCoordinate LtsCoordTrans LtsSession LtsMultiMonitor DataPluginInterface GuiPluginInterface CoPrtCnv LogViewLogger LogView PrtCnvLib PrtCnv LtsLicence MockCoordTrans aes_crypt_test ngltools_qt_smoke lts_coord_trans_unit_test test_nglpdfwidget coprtcnv_unit_test logview_unit_test prtcnv_unit_test)
|
||||||
|
GROUP5_TARGETS=(ddsview LogViewer sqlbrowser)
|
||||||
|
GROUP6_TARGETS=(ngl_codegen)
|
||||||
|
|
||||||
|
build_group() {
|
||||||
|
local group_name="$1"
|
||||||
|
local build_flag="$2"
|
||||||
|
shift 2
|
||||||
|
local targets=("$@")
|
||||||
|
|
||||||
|
if [[ "${build_flag}" != "ON" ]]; then
|
||||||
|
log_info "Skipping ${group_name} (disabled)"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_info "Building ${group_name}..."
|
||||||
|
for target in "${targets[@]}"; do
|
||||||
|
log_info " Building: ${target}"
|
||||||
|
cmake --build "${BUILD_DIR}" --target "${target}" -j$(nproc) || die "Failed to build ${target}"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
build_group "GROUP1 (DDS/AP4)" "${BUILD_GROUP1}" "${GROUP1_TARGETS[@]}"
|
||||||
|
build_group "GROUP3 (Lts/AP3)" "${BUILD_GROUP3}" "${GROUP3_TARGETS[@]}"
|
||||||
|
build_group "GROUP5 (Viewer/AP9)" "${BUILD_GROUP5}" "${GROUP5_TARGETS[@]}"
|
||||||
|
build_group "GROUP6 (Tools/AP9)" "${BUILD_GROUP6}" "${GROUP6_TARGETS[@]}"
|
||||||
|
|
||||||
|
# Run tests if enabled
|
||||||
|
if [[ "${RUN_CTEST}" == "ON" ]] && [[ "${TESTS_ONLY}" != "ON" ]]; then
|
||||||
|
log_info "Running ctest..."
|
||||||
|
cd "${BUILD_DIR}"
|
||||||
|
ctest --output-on-failure -j$(nproc) || log_info "Some tests failed (continuing)"
|
||||||
|
cd ..
|
||||||
|
fi
|
||||||
|
|
||||||
|
# DEB Package Production (in-tree rpmbuild)
|
||||||
|
if [[ "${RUN_JENKINS_BUILDER}" == "ON" ]]; then
|
||||||
|
log_info "=== DEB Package Production (in-tree rpmbuild) ==="
|
||||||
|
|
||||||
|
# Extract OS version for package naming
|
||||||
|
OS_VERSION=$(eval $(grep "^VERSION_ID=" /etc/os-release) && echo "$VERSION_ID")
|
||||||
|
STAGE_DIR="${DOCKER_MOUNT_ROOT}/deb_stage"
|
||||||
|
STAGED_SOURCE_DIR="${STAGE_DIR}"
|
||||||
|
WORKSPACE_DIR="${DOCKER_MOUNT_ROOT}/qt-migration-legatus/qt6-after/qt6-migrated-legatus"
|
||||||
|
|
||||||
|
log_info "Staging workspace to ${STAGE_DIR}"
|
||||||
|
rm -rf "${STAGE_DIR}"
|
||||||
|
mkdir -p "${STAGE_DIR}"
|
||||||
|
tar --exclude='./rpms' --exclude='./.git' --exclude='./build' \
|
||||||
|
--exclude='./deb_build_tmp' --exclude='./deb_stage' --exclude='./packages-out' \
|
||||||
|
--exclude='./legatus-qt6_1.0.tar.gz' \
|
||||||
|
-cf - -C "${WORKSPACE_DIR}" . | tar -xf - -C "${STAGE_DIR}"
|
||||||
|
|
||||||
|
if [[ ! -f "${STAGED_SOURCE_DIR}/CMakeLists.txt" || ! -f "${STAGED_SOURCE_DIR}/rpmbuild/make_rpm_ubuntu26_release2.py" ]]; then
|
||||||
|
log_error "Staged source incomplete under ${STAGED_SOURCE_DIR} (CMakeLists.txt or rpmbuild/make_rpm_ubuntu26_release2.py missing)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_info "Running ${STAGED_SOURCE_DIR}/rpmbuild/make_rpm_ubuntu26_release2.py with:"
|
||||||
|
log_info " PROJECT=${PROJECT}"
|
||||||
|
log_info " OS_VERSION=${OS_VERSION}"
|
||||||
|
log_info " LTS_VERSION=${LTS_VERSION}"
|
||||||
|
log_info " GUEZ_MODE=${GUEZ_MODE}"
|
||||||
|
log_info " BUILD_NUMBER=${BUILD_NUMBER}"
|
||||||
|
log_info " BUILD_TAG=${BUILD_TAG}"
|
||||||
|
|
||||||
|
cd "${STAGED_SOURCE_DIR}/rpmbuild"
|
||||||
|
if python3 make_rpm_ubuntu26_release2.py -c LTS \
|
||||||
|
--project_name "${PROJECT}" \
|
||||||
|
--version "${LTS_VERSION}" \
|
||||||
|
--output_dir "${DOCKER_MOUNT_ROOT}/rpms/${PROJECT}/${OS_VERSION}/" \
|
||||||
|
--source_dir "${STAGED_SOURCE_DIR}" \
|
||||||
|
--cmake_build_flags "-DUSE_IPO=ON -DUSE_UNITY_BUILD=ON -DGUEZ_MODE=${GUEZ_MODE} -DBUILD_WLS=ON -DPostgreSQL_TYPE_INCLUDE_DIR=/usr/include/postgresql/ -DRELEASE_BUILD=ON" \
|
||||||
|
--build_number "${BUILD_NUMBER}" \
|
||||||
|
--release_scope; then
|
||||||
|
log_info "Package build completed successfully"
|
||||||
|
else
|
||||||
|
log_error "Package build failed (exit code: $?)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Copy produced DEB packages to the packages-out
|
||||||
|
DEST_DIR="${DOCKER_MOUNT_ROOT}/packages-out"
|
||||||
|
mkdir -p "${DEST_DIR}"
|
||||||
|
shopt -s nullglob
|
||||||
|
for deb in "${DOCKER_MOUNT_ROOT}/rpms/${PROJECT}/${OS_VERSION}/"*.deb; do
|
||||||
|
base="$(basename "${deb}")"
|
||||||
|
if [[ -e "${DEST_DIR}/${base}" ]] &&
|
||||||
|
[[ "$(stat -c '%d:%i' "${deb}")" == "$(stat -c '%d:%i' "${DEST_DIR}/${base}")" ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
cp -f "${deb}" "${DEST_DIR}/"
|
||||||
|
done
|
||||||
|
shopt -u nullglob
|
||||||
|
log_info "DEB packages available in ${DEST_DIR} (host: ${PACKAGE_OUTPUT_DIR:-unknown}):"
|
||||||
|
ls -lh "${DEST_DIR}/"
|
||||||
|
else
|
||||||
|
log_info "Skipping DEB package production"
|
||||||
|
fi
|
||||||
|
|
||||||
|
log_info "Release 2 build completed successfully!"
|
||||||
|
'
|
||||||
|
)
|
||||||
|
|
||||||
|
log_info "Starting Docker container..."
|
||||||
|
docker run "${DOCKER_RUN_ARGS[@]}"
|
||||||
|
|
||||||
|
log_info "Build script completed."
|
||||||
Executable → Regular
+245
-642
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user