// Entry point of the release pipeline for the Qt6-migrated legatus
// validation-scope branch (story/release-validation-scope).
//
// Lives in jenkins-ci-rme/ of the DLBO Qt6 repo. Declares the job properties,
// allocates the build node, checks out the repo with its submodules and
// loads the build body from jenkins-ci-rme/jenkins/Jenkinsfile.

properties([
    disableConcurrentBuilds(),
    parameters([
        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'),
        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: 'RunCoverage', defaultValue: true, description: 'Build the release scope with -O0 --coverage, run ctest, collect the lcov report and archive it')
    ])
])

node('jenkins-linux-node-2.sl.defence-elec.de') {
    stage('Init submodule') {
        if (params.ClearWorkspace) {
            cleanWs()
        }
        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'
}
