From f8b865e4e08028632193bdae74c7c7accc8c8bde Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sun, 19 Feb 2023 12:55:31 +0100 Subject: [PATCH 1/4] Generalizing Jenkinsfile --- Jenkinsfile-linux | 65 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Jenkinsfile-linux diff --git a/Jenkinsfile-linux b/Jenkinsfile-linux new file mode 100644 index 000000000..0bb82e97d --- /dev/null +++ b/Jenkinsfile-linux @@ -0,0 +1,65 @@ + +@Library("osconfig") _ + +properties([disableConcurrentBuilds()]) + +// from shared library +target = osconfig() + +currentBuild.description = "Pipelined " + target + +node("linux") { + + artefacts = pwd() + "/artefacts" + target_dir = artefacts + "/" + target + + stage("Checkout sources") { + + checkout scm + checkout_private() + + } + + stage("Building target ${target}") { + + withDockerContainer(image: "jenkins-${target}") { + // from shared library + build(target, target_dir) + } + + } + + stage("Publish and test") { + + parallel( + "Publish": { + + // from shared library - only publish for normal branch, not for PR + if (! BRANCH_NAME.startsWith('PR')) { + publish(BRANCH_NAME, target, target_dir) + } + + }, + "Unit testing": { + + ut_result = "no-result" + withDockerContainer(image: "jenkins-${target}") { + ut_result = run_ut(target) + } + + junit(testResults: ut_result) + + }, + "Installtest": { + + withDockerContainer(image: "jenkins-${target}-basic") { + // from shared library + installtest_nopython(target, target_dir) + } + + }) + + } + +} + From 82f9a7543d490091cd868422be7c02b3d4334f29 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 24 Feb 2023 00:00:40 +0100 Subject: [PATCH 2/4] Added docker_args config to multipipeline Jenkins file for Linux cluster --- Jenkinsfile-linux | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile-linux b/Jenkinsfile-linux index 0bb82e97d..4b59d2ff1 100644 --- a/Jenkinsfile-linux +++ b/Jenkinsfile-linux @@ -5,6 +5,7 @@ properties([disableConcurrentBuilds()]) // from shared library target = osconfig() +docker_args = docker_args() currentBuild.description = "Pipelined " + target @@ -22,7 +23,7 @@ node("linux") { stage("Building target ${target}") { - withDockerContainer(image: "jenkins-${target}") { + withDockerContainer(image: "jenkins-${target}", args: docker_args) { // from shared library build(target, target_dir) } @@ -43,7 +44,7 @@ node("linux") { "Unit testing": { ut_result = "no-result" - withDockerContainer(image: "jenkins-${target}") { + withDockerContainer(image: "jenkins-${target}", args: docker_args) { ut_result = run_ut(target) } @@ -52,7 +53,7 @@ node("linux") { }, "Installtest": { - withDockerContainer(image: "jenkins-${target}-basic") { + withDockerContainer(image: "jenkins-${target}-basic", args: docker_args) { // from shared library installtest_nopython(target, target_dir) } From 3ac791234a7e8e6aadbf95b2502cb6bc7e2556cc Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 24 Feb 2023 14:47:23 +0100 Subject: [PATCH 3/4] Adjusting Jenkinsfiles to Linux cluster --- Jenkinsfile-publish-doc | 2 +- Jenkinsfile-publish-sources | 2 +- Jenkinsfile-pypi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile-publish-doc b/Jenkinsfile-publish-doc index e7a3f453b..24db16275 100644 --- a/Jenkinsfile-publish-doc +++ b/Jenkinsfile-publish-doc @@ -3,7 +3,7 @@ properties([disableConcurrentBuilds()]) -node("master") { +node("linux") { stage("Checkout sources") { checkout scm diff --git a/Jenkinsfile-publish-sources b/Jenkinsfile-publish-sources index 0ed9f228e..91ac205f1 100644 --- a/Jenkinsfile-publish-sources +++ b/Jenkinsfile-publish-sources @@ -3,7 +3,7 @@ properties([disableConcurrentBuilds()]) -node("master") { +node("linux") { stage("Checkout sources") { checkout scm diff --git a/Jenkinsfile-pypi b/Jenkinsfile-pypi index 632fab52e..44d0e6d2f 100644 --- a/Jenkinsfile-pypi +++ b/Jenkinsfile-pypi @@ -14,7 +14,7 @@ currentBuild.description = "PyPI deployment " + platform docker_image = "jenkins-manylinux2014_x86_64-pypi" target = platform + ".whl" -node("master") { +node("linux") { stage("Checkout sources") { checkout scm From 3bef4917ad748446eaf554c9410fb04134d19267 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 24 Feb 2023 18:33:24 +0100 Subject: [PATCH 4/4] Fixed doc publishing Jenkinsfile --- Jenkinsfile-publish-doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile-publish-doc b/Jenkinsfile-publish-doc index 24db16275..619c89019 100644 --- a/Jenkinsfile-publish-doc +++ b/Jenkinsfile-publish-doc @@ -10,7 +10,7 @@ node("linux") { } stage("Producing doc") { - sh "./scripts/extract_user_doc.sh -i " + BRANCH_NAME + linux_sh "./scripts/extract_user_doc.sh -i " + BRANCH_NAME } stage("Publish doc") {