From 3c414726499e5729667e6f62a67ad5dd9d5bc7e9 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 26 Oct 2021 20:30:22 +0200 Subject: [PATCH 1/4] tweaking Jenkinsfile --- automation/Jenkinsfile | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index a90037f8..e5b5ecda 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -1,12 +1,10 @@ pipeline { agent any + environment { + BUILDDIR = 'build-unittests' + } stages { - stage('Clean') { - steps { - sh 'rm -rf build-unittests' - } - } - stage('Build') { + stage('Configure') { agent { dockerfile { dir 'automation' @@ -15,8 +13,21 @@ pipeline { } } steps { - dir('build-unittests') { + sh 'rm -rf $BUILDDIR' + dir($BUILDDIR) { sh 'cmake -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON ..' + } + } + } + stage('Build') { + agent { + dockerfile { + dir 'automation' + reuseNode true + } + } + steps { + dir($BUILDDIR) { sh 'cmake --build . -j' } } @@ -29,7 +40,7 @@ pipeline { } } steps { - dir('build-unittests') { + dir($BUILDDIR) { sh 'cmake --build . -- fsfw-tests_coverage -j' } } From 1923b339e92772f3f43cbc7942d3c75baca35e02 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 26 Oct 2021 20:47:53 +0200 Subject: [PATCH 2/4] I can not jenkins --- automation/Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index e5b5ecda..9dc716a6 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { } steps { sh 'rm -rf $BUILDDIR' - dir($BUILDDIR) { + dir(env.BUILDDIR) { sh 'cmake -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON ..' } } @@ -27,7 +27,7 @@ pipeline { } } steps { - dir($BUILDDIR) { + dir(BUILDDIR) { sh 'cmake --build . -j' } } @@ -40,7 +40,7 @@ pipeline { } } steps { - dir($BUILDDIR) { + dir(BUILDDIR) { sh 'cmake --build . -- fsfw-tests_coverage -j' } } From b02f737418b59c1724b9ee8b64defff1f5d19623 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 26 Oct 2021 20:53:08 +0200 Subject: [PATCH 3/4] jenkins cosmetics --- automation/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 9dc716a6..6a5d94b5 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { } steps { sh 'rm -rf $BUILDDIR' - dir(env.BUILDDIR) { + dir(BUILDDIR) { sh 'cmake -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON ..' } } From da42edcc0cc49a81d1dca5a897aa2ab73accd600 Mon Sep 17 00:00:00 2001 From: Ulrich Mohr Date: Tue, 26 Oct 2021 20:58:34 +0200 Subject: [PATCH 4/4] Jenkinsfile: added stage to be more verbose --- automation/Jenkinsfile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 6a5d94b5..0cb973bd 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { BUILDDIR = 'build-unittests' } stages { - stage('Configure') { + stage('Create Docker') { agent { dockerfile { dir 'automation' @@ -14,6 +14,16 @@ pipeline { } steps { sh 'rm -rf $BUILDDIR' + } + } + stage('Configure') { + agent { + dockerfile { + dir 'automation' + reuseNode true + } + } + steps { dir(BUILDDIR) { sh 'cmake -DFSFW_OSAL=host -DFSFW_BUILD_UNITTESTS=ON ..' }