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

Passing parameters to a Github Organization pipeline job fails #24

@chenfli

Description

@chenfli

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions