From eba5fcdf3a201a1359d90ee8a5148767f831f3f7 Mon Sep 17 00:00:00 2001 From: lucianom Date: Tue, 7 Sep 2021 14:12:32 +0100 Subject: [PATCH 1/7] Add Jenkins stage and update version --- CHANGELOG.rst | 5 +++++ Jenkinsfile | 10 +++++++++- xscope_fileio/module_build_info | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ee4de7e..c7d7592 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,11 @@ xscope_fileo ============ +0.3.1 +----- + + * ADDED: Jenkins stage to update view files automatically + 0.3.0 ----- * ADDED: Jenkins driven file transfer test diff --git a/Jenkinsfile b/Jenkinsfile index a8c4d80..e8d7e47 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -107,6 +107,14 @@ pipeline { } } } + stage('Update view files') { + when { + expression { return currentBuild.currentResult == "SUCCESS" } + } + steps { + updateViewfiles() + } + } } } } @@ -121,4 +129,4 @@ pipeline { cleanWs() } } -} \ No newline at end of file +} diff --git a/xscope_fileio/module_build_info b/xscope_fileio/module_build_info index e4e7a79..cc2ad23 100644 --- a/xscope_fileio/module_build_info +++ b/xscope_fileio/module_build_info @@ -1,4 +1,4 @@ -VERSION = 0.3.0 +VERSION = 0.3.1 MODULE_XCC_FLAGS = $(XCC_FLAGS) From fd57a1f83569c66bc995533c2f171dee0b824ff4 Mon Sep 17 00:00:00 2001 From: lucianom Date: Tue, 7 Sep 2021 14:15:31 +0100 Subject: [PATCH 2/7] Move stage out of parallel stages --- Jenkinsfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e8d7e47..717cc52 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -107,13 +107,13 @@ pipeline { } } } - stage('Update view files') { - when { - expression { return currentBuild.currentResult == "SUCCESS" } - } - steps { - updateViewfiles() - } + } + stage('Update view files') { + when { + expression { return currentBuild.currentResult == "SUCCESS" } + } + steps { + updateViewfiles() } } } From 5e9061ff416cab3448eac5777c08dd684111dd1b Mon Sep 17 00:00:00 2001 From: lucianom Date: Tue, 7 Sep 2021 14:17:37 +0100 Subject: [PATCH 3/7] Fix brackets --- Jenkinsfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 717cc52..d33f663 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -108,13 +108,13 @@ pipeline { } } } - stage('Update view files') { - when { - expression { return currentBuild.currentResult == "SUCCESS" } - } - steps { - updateViewfiles() - } + } + stage('Update view files') { + when { + expression { return currentBuild.currentResult == "SUCCESS" } + } + steps { + updateViewfiles() } } } From 7fa6b40f69732a7f908086ad2723c34c61381909 Mon Sep 17 00:00:00 2001 From: lucianom Date: Tue, 7 Sep 2021 15:28:37 +0100 Subject: [PATCH 4/7] Set env variables --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d33f663..a174aca 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -114,7 +114,9 @@ pipeline { expression { return currentBuild.currentResult == "SUCCESS" } } steps { - updateViewfiles() + withEnv(["SAVED_GIT_URL=$GIT_URL","SAVED_GIT_COMMIT=GIT_COMMIT"] { + updateViewfiles() + } } } } From cda52761164ef9b2b320144eafc8ad74e505262c Mon Sep 17 00:00:00 2001 From: lucianom Date: Tue, 7 Sep 2021 15:31:25 +0100 Subject: [PATCH 5/7] Add missing bracket --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a174aca..3e95eb0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -114,7 +114,7 @@ pipeline { expression { return currentBuild.currentResult == "SUCCESS" } } steps { - withEnv(["SAVED_GIT_URL=$GIT_URL","SAVED_GIT_COMMIT=GIT_COMMIT"] { + withEnv(["SAVED_GIT_URL=$GIT_URL","SAVED_GIT_COMMIT=GIT_COMMIT"]) { updateViewfiles() } } From 4de0e4acf1982f954716a851d943a15ee5a4161b Mon Sep 17 00:00:00 2001 From: lucianom Date: Tue, 7 Sep 2021 15:43:37 +0100 Subject: [PATCH 6/7] Try second proposal by Brennan --- Jenkinsfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3e95eb0..57cfc71 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -114,9 +114,14 @@ pipeline { expression { return currentBuild.currentResult == "SUCCESS" } } steps { - withEnv(["SAVED_GIT_URL=$GIT_URL","SAVED_GIT_COMMIT=GIT_COMMIT"]) { - updateViewfiles() + script { + dir("${repo}") { + current_scm = checkout scm + env.SAVED_GIT_URL = current_scm.GIT_URL + env.SAVED_GIT_COMMIT = current_scm.GIT_COMMIT + } } + updateViewfiles() } } } From 3b270a55d23d16288a3381155df8cdf5ae498aea Mon Sep 17 00:00:00 2001 From: lucianom Date: Tue, 7 Sep 2021 15:46:13 +0100 Subject: [PATCH 7/7] Remove dir() statement --- Jenkinsfile | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 57cfc71..faae28e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -115,11 +115,9 @@ pipeline { } steps { script { - dir("${repo}") { - current_scm = checkout scm - env.SAVED_GIT_URL = current_scm.GIT_URL - env.SAVED_GIT_COMMIT = current_scm.GIT_COMMIT - } + current_scm = checkout scm + env.SAVED_GIT_URL = current_scm.GIT_URL + env.SAVED_GIT_COMMIT = current_scm.GIT_COMMIT } updateViewfiles() }