i'm new jenkins pipeline plugin, , new multibranch pipeline plugin. in standard build have access $git_branch variable know branch being built. variable isn't set in multibranch pipeline. have tried env.git_branch too, , tried pass $git_branch parameter build. nothing seems work. assumed since build knows branch being built (i can see branch name @ top of console output, there can use, can't find reference it.
here example of why important. using gitflow pattern. have dev, release, , master branches used create artifacts. dev branch auto deploys, other 2 not. there feature, bugfix , hotfix branches. these branches should built, not produce artifact. should used inform developer if there problem code. need know branch being built in order run correct steps.
any appreciated.
the env.branch_name
variable contains branch name.
as of pipeline groovy plugin 2.18, can use branch_name
(env
isn't required still accepted.)
Comments
Post a Comment