c.f.
git status
git add *
git commit -s -m “GitHub pollutes everything”public void sayHello(String Name) {
System.out.println("Hello {}".format(name));c.f.
git status
git add *
git commit -s -m “GitHub pollutes everything”public void sayHello(String Name) {
System.out.println("Hello {}".format(name));| pipeline { | |
| agent any | |
| environment { | |
| COMMITDATE = "" | |
| } | |
| stages { | |
| stage('setup') { | |
| steps { | |
| script { | |
| COMMITDATE = sh(returnStdout: true, script: "git show -s --format=%ci ${GIT_COMMIT}") |
The Jenkins documentation makes a reference to currentBuild.buildVariables for fetching variables from downstream jobs.
for a Pipeline downstream build, any variables set globally on env at the time the build ends. Child Pipeline jobs can use this to report additional information to the parent job by setting variables in env. Note that build parameters are not shown in buildVariables.
It took me a bit to catch on that set globally was the key part. if you want any environment variables, like the NODE_NAME passed back to the parent job, you need to explicitly set them in the child job.
| pipeline { | |
| agent { | |
| label 'aws' | |
| } | |
| environment { | |
| JBOSSADMIN = credentials('jboss-admin') | |
| MAVEN_SETTINGS = credentials('maven-settings-windows') | |
| } | |
| tools { | |
| maven 'Maven35' |
| pipeline { | |
| agent { | |
| label 'aws' | |
| } | |
| tools { | |
| maven 'Maven35' | |
| jdk 'jdk-1.8.0-aws' | |
| } | |
| stages { | |
| stage('Build') { |
| pipeline { | |
| agent any | |
| environment { | |
| PROJECT = 'myproj' | |
| SITE_PART = 'booking' | |
| TG_BOT_ID_TOKEN = credentials('bot_token') | |
| TG_CHAT_ID__TestChaT = credentials('TG_CHAT_ID__TestChaT') |
| #!/usr/bin/env Groovy | |
| pipeline { | |
| agent any | |
| tools { | |
| maven 'Maven35' | |
| } | |
| stages { | |
| stage('Build') { | |
| sh 'mvn -B -V clean deploy' |
| sh '''TEST=1 | |
| echo $TEST | |
| ''' |
| package hello.model; | |
| import javax.persistence.*; | |
| @Entity | |
| @Table(name = "log", catalog = "log") | |
| public class LogEvent { | |
| @Id | |
| @GeneratedValue | |
| private Long id; |
| //empty file |