Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Passing parameters to a Github Organization pipeline job fails #24

Open
chenfli opened this issue Mar 6, 2019 · 0 comments
Open

Passing parameters to a Github Organization pipeline job fails #24

chenfli opened this issue Mar 6, 2019 · 0 comments

Comments

@chenfli
Copy link

chenfli commented Mar 6, 2019

Hi @morficus,

The bug I experienced is around receiving parameters between 2 jobs.
Both jobs are Github Organization jobs, it means the 1st one is invoked by a GitHub webhook invocation. The 2nd one is created using Github webhooks but invoked by the 1st one.

Both jobs are pipeline declarative jobs with a shared library.

The invocation of the 2nd job code looks like this:

 script.triggerRemoteJob remoteJenkinsName: "remote-jenkins",
                          job: **<Github job name>/<git repository>/<branch name>**,
                          blockBuildUntilComplete: true,
                          parameters: "tag=xyz",
                          abortTriggeredJob: true

The invoked job (2nd Jenkins) looks like this

pipeline {
 
    parameters { 
         string(name: 'tag',  description: 'a tag')
    }
    stages{
           stage('test-params'){
               print "DEBUG: params" + params
           }
   } 
}

Output on 2nd job is

DEBUG: params[tag:null]

I believe that most of the problem is about the way Jenkins pipelines are created. Since this problem usually happens on new branches 1st build.

Is there a way to workaround this issue ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant