From 997ebb07f8de8f20066a4b26ffb6e42cf7815cfd Mon Sep 17 00:00:00 2001 From: Ivan Verhun Date: Thu, 11 Oct 2018 11:33:59 +0300 Subject: [PATCH 01/11] tmp1 --- Jenkinsfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6df12ce..0b796cc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -66,7 +66,10 @@ pipeline { } steps { script { - env.SKIP_AUTO_RUN = params.post_title == '' + println currentBuild.rawBuild.getCauses()[0].toString().contains('SCMTriggerCause') + // env.SKIP_AUTO_RUN = params.post_title == '' + env.SKIP_AUTO_RUN = currentBuild.rawBuild.getCauses()[0].toString().contains('SCMTriggerCause') + sh 'printenv' } } } @@ -145,6 +148,7 @@ pipeline { } } +/* stage('Post reminders') { when { branch 'master' @@ -156,6 +160,8 @@ pipeline { } } } + */ + } post { From 0417611f8a51fb122ad89e2a0894ebecba80d8da Mon Sep 17 00:00:00 2001 From: Ivan Verhun Date: Thu, 11 Oct 2018 11:42:44 +0300 Subject: [PATCH 02/11] tmp2 --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0b796cc..c401541 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -61,9 +61,9 @@ pipeline { stages { stage('Set up env') { - when { - branch 'master' - } + //when { + // branch 'master' + // } steps { script { println currentBuild.rawBuild.getCauses()[0].toString().contains('SCMTriggerCause') @@ -76,7 +76,7 @@ pipeline { stage('Set up git env') { when { - branch 'master' + // branch 'master' environment name: 'SKIP_AUTO_RUN', value: 'false' } steps { @@ -93,7 +93,7 @@ pipeline { stage('Prepare post') { when { - branch 'master' + //branch 'master' environment name: 'SKIP_AUTO_RUN', value: 'false' } steps { @@ -130,7 +130,7 @@ pipeline { stage('Create post') { when { - branch 'master' + //branch 'master' environment name: 'SKIP_AUTO_RUN', value: 'false' } steps { From 9fd9a1824824da70bb41c7a889987d4c41eef56e Mon Sep 17 00:00:00 2001 From: Ivan Verhun Date: Thu, 11 Oct 2018 11:46:10 +0300 Subject: [PATCH 03/11] Trigger build From 7144eb6dabda97657b6cb28b5532dd90e3ca95d3 Mon Sep 17 00:00:00 2001 From: Ivan Verhun Date: Thu, 11 Oct 2018 11:47:39 +0300 Subject: [PATCH 04/11] Trigger build From 2434ad774f569efdcd26253ff2a4b579c3923114 Mon Sep 17 00:00:00 2001 From: Ivan Verhun Date: Thu, 11 Oct 2018 11:49:16 +0300 Subject: [PATCH 05/11] tmp3 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index c401541..4357356 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -66,7 +66,7 @@ pipeline { // } steps { script { - println currentBuild.rawBuild.getCauses()[0].toString().contains('SCMTriggerCause') + println "================ " + currentBuild.rawBuild.getCauses() //[0].toString().contains('SCMTriggerCause') // env.SKIP_AUTO_RUN = params.post_title == '' env.SKIP_AUTO_RUN = currentBuild.rawBuild.getCauses()[0].toString().contains('SCMTriggerCause') sh 'printenv' From 34743fb46cb808d21a7dba52d590dfabd9415b59 Mon Sep 17 00:00:00 2001 From: Ivan Verhun Date: Thu, 11 Oct 2018 11:50:33 +0300 Subject: [PATCH 06/11] tmp4 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4357356..a45557b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -66,7 +66,7 @@ pipeline { // } steps { script { - println "================ " + currentBuild.rawBuild.getCauses() //[0].toString().contains('SCMTriggerCause') + sh "echo ================ ${currentBuild.rawBuild.getCauses()" // env.SKIP_AUTO_RUN = params.post_title == '' env.SKIP_AUTO_RUN = currentBuild.rawBuild.getCauses()[0].toString().contains('SCMTriggerCause') sh 'printenv' From 7151259c90b849875cd1c931156d47630b2bbd5b Mon Sep 17 00:00:00 2001 From: Ivan Verhun Date: Thu, 11 Oct 2018 11:52:08 +0300 Subject: [PATCH 07/11] tmp5 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a45557b..1c0c2d5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -66,7 +66,7 @@ pipeline { // } steps { script { - sh "echo ================ ${currentBuild.rawBuild.getCauses()" + sh "echo ================ ${currentBuild.rawBuild.getCauses()}" // env.SKIP_AUTO_RUN = params.post_title == '' env.SKIP_AUTO_RUN = currentBuild.rawBuild.getCauses()[0].toString().contains('SCMTriggerCause') sh 'printenv' From 0b81746790b10904d6b675cd87b1162633d7b39f Mon Sep 17 00:00:00 2001 From: Ivan Verhun Date: Thu, 11 Oct 2018 11:53:27 +0300 Subject: [PATCH 08/11] tmp6 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 1c0c2d5..4e087c5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -66,7 +66,7 @@ pipeline { // } steps { script { - sh "echo ================ ${currentBuild.rawBuild.getCauses()}" + sh "echo ================ ${currentBuild.rawBuild.getCauses()[0].toString()}" // env.SKIP_AUTO_RUN = params.post_title == '' env.SKIP_AUTO_RUN = currentBuild.rawBuild.getCauses()[0].toString().contains('SCMTriggerCause') sh 'printenv' From 7c059960575be623c2a431c7a81cf781d15467ac Mon Sep 17 00:00:00 2001 From: Ivan Verhun Date: Thu, 11 Oct 2018 11:56:17 +0300 Subject: [PATCH 09/11] tmp7 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4e087c5..d82c686 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -68,7 +68,7 @@ pipeline { script { sh "echo ================ ${currentBuild.rawBuild.getCauses()[0].toString()}" // env.SKIP_AUTO_RUN = params.post_title == '' - env.SKIP_AUTO_RUN = currentBuild.rawBuild.getCauses()[0].toString().contains('SCMTriggerCause') + env.SKIP_AUTO_RUN = !currentBuild.rawBuild.getCauses()[0].toString().contains('UserIdCause') sh 'printenv' } } From a8c0b995094ae9684c03150a13a806584d6c1a0f Mon Sep 17 00:00:00 2001 From: Ivan Verhun Date: Thu, 11 Oct 2018 11:58:17 +0300 Subject: [PATCH 10/11] cleanup --- Jenkinsfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d82c686..f9241a2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -66,10 +66,7 @@ pipeline { // } steps { script { - sh "echo ================ ${currentBuild.rawBuild.getCauses()[0].toString()}" - // env.SKIP_AUTO_RUN = params.post_title == '' env.SKIP_AUTO_RUN = !currentBuild.rawBuild.getCauses()[0].toString().contains('UserIdCause') - sh 'printenv' } } } From be52647fa678c82aae784cc2ba615c051233a9d1 Mon Sep 17 00:00:00 2001 From: Ivan Verhun Date: Thu, 11 Oct 2018 12:01:04 +0300 Subject: [PATCH 11/11] test title default value 1 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f9241a2..91e0e12 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { string( name: 'post_title', description: 'Used for filename and post.sh name. The space will be replaced by `-` inv the file name.', - defaultValue: '' + defaultValue: "${env.GIT_COMMIT} _ hello" ) text( name: 'post_body',