Last active
January 12, 2021 10:57
Revisions
-
fty4 revised this gist
Jan 12, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ pipeline { script { GIT_TAG = sh ( # will grep latest branch with versioning pattern (like v1.0, v22.44.66) script: 'git tag --contains HEAD | egrep "v(\\d+\\.?){0,3}" | head -n1', returnStdout: true ).trim() } -
fty4 revised this gist
Jan 12, 2021 . 2 changed files with 4 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,6 @@ - add each job via scm to Jenkins (named as job1 and job2 -> job1.Jenkinsfile has 'job2' defined as jobname - enable 'GitHub hook trigger for GITScm polling' on job1 - set pipeline repo of job1 to match only releases (= tags/*):<br /> Pipeline.Definition.SCM.Git.Repositories.Refspec: `'+refs/tags/v*':'refs/remotes/origin/tags/v*'`<br /> Pipeline.Definition.SCM.Git.BranchesToBuild.BranchSpecifier: `**/tags/v**` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,8 @@ pipeline { steps { script { GIT_TAG = sh ( # will grep latest branch with versioning pattern (like v1.0, v22.44.66) script: 'git tag --contains HEAD | egrep "v(\d+\.?){0,3}" | head -n1', returnStdout: true ).trim() } -
fty4 revised this gist
Jan 12, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ # README - add each job via scm to Jenkins (named as job1 and job2 -> job1.Jenkinsfile has 'job2' defined as jobname - enable 'GitHub hook trigger for GITScm polling' on job1 - set pipeline repo of job1 to match only releases (= tags/*):<br /> Pipeline.Definition.SCM.Git.Repositories.Refspec: `'+refs/tags/*':'refs/remotes/origin/tags/*'`<br /> Pipeline.Definition.SCM.Git.BranchesToBuild.BranchSpecifier: `**/tags/**` -
fty4 created this gist
Jan 12, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ # README - add each job via scm to Jenkins (named as job1 and job2 -> job1.Jenkinsfile has 'job2' defined as jobname - enable 'GitHub hook trigger for GITScm polling' on job1 - set pipeline repo of job1 to match only releases (= tags/*): Pipeline.Definition.SCM.Git.Repositories.Refspec: `'+refs/tags/*':'refs/remotes/origin/tags/*'` Pipeline.Definition.SCM.Git.BranchesToBuild.BranchSpecifier: `**/tags/**` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ pipeline { agent any stages { stage('Beispiel') { steps { script { GIT_TAG = sh ( script: 'git tag --contains HEAD', returnStdout: true ).trim() } } } } post { always { build job: 'job2', parameters: [[$class: 'StringParameterValue', name: 'passed_param', value: String.valueOf(GIT_TAG)]] } } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ pipeline { agent any parameters{ string( name: 'passed_param', defaultValue: 'TESTING', description: 'The target environment', ) } stages { stage('Example') { steps { echo params.passed_param } } } }