Either I am doing it wrong, or Multibranch pipeline has no way of sending
parameters to downstream builds.
Considering that each branch within a multibranch pipeline seems to be a
single Pipeline project and standard such Pipeline projects can be
parameterized.
onsdag 8. juni 2016 12.42.01 UTC+2 skrev Sverre Moe følgende:
>
> 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/28cdfb41-9d07-4d95-b9fc-9561159560e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.