Jenkins Pipeline can be parameterized, but not multibranch pipelines. There 
is no option for "This build is parameterized" in the configuration of a 
multibranch pipeline. Why is that?

I have a multibranch project for each repository with multiple branches.

ProjectA
    master
    develop
    releaseX
ProjectB
    master
    develop
    releaseX

In this case ProjectB has a dependency on ProjectA on the same branch.

The Jenkinsfile is sparse, while the common main build logic is stored in 
workflowLibs.git

When a upstream project builds a dependent downstream project I need to 
provide them with build parameters.
def BUILD_PROJECT = "projectB"+"/"+env.BUILD_BRANCH
build job: BUILD_PROJECT, parameters: [[$class: 'BooleanParameterValue', 
name: 'UPSTREAM_TRIGGERED', value: true]]
I have some logic in the main build script for when the build is triggered 
by an upstream dependency.

Not sure how I can do this since multibranch pipeline cannot be 
parameterized.

I have even tried withEnv, but it did not work
withEnv(["UPSTREAM_TRIGGERED=true"]) {
    def BUILD_PROJECT = "projectB"+"/"+env.BUILD_BRANCH
    build BUILD_PROJECT
}

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c1f63e4e-10d7-49f6-8dc5-db21be98e2df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to