Different values for Run Parameter collapse in the same job execution

11 views
Skip to first unread message

Joan Tomàs-Buliart

unread,
Mar 7, 2019, 4:46:35 AM3/7/19
to Jenkins Users
Hi,

we are using Run Parameter in some of our jobs and we are migrating them to declarative pipeline. We have noticed that, when we trigger the job with different run parameter, all the jobs on the queue are collapsed to just one. I assume that Jenkins, in order to decide if 2 jobs could be collapsed in just 1 run, it compares the parameters object $params. The problem is that for Run Parameters, $params.RUN_PARAM_NAME is null and this is why it is not considered. Just to give a little bit off context:

- we are using Jenkins 2.94
- the test jenkins file is this:
pipeline {
    agent { node { label 'docker' } }
    parameters {
        run description: 'test', filter: 'STABLE', name: 'TEST_PARAMETER', projectName: 'UpstreamJob'
    }
    stages {
        stage('Docker build and start') {
            steps {
                sh "env"
                sh 'sleep 5'
                sh "echo ${params.TEST_PARAMETER}"
            }
        }
    }
    options {
        disableConcurrentBuilds()
    }
}

Mainly, 2 main questions appears:
- it is something that it is not well configured or it is a bug?
- Any workaround to manage it?

Many thanks in advance,

Joan
Reply all
Reply to author
Forward
0 new messages