Change 25564

paul_allen (Paul Allen)
Paul Allen committed this change into //guest/perforce_software/p4jenkins/main/src
Request Review
Download .zip
Merge branch 'local_map'

MultiBranch support for 'HelixBranches' local and remote Mappings.

Allows MultiBranches to map Depot paths external to the MultiBranch projects root.  For example, a MultiBranch project with the following Jenkinsfiles:

ProjA >> main
    //depot/projA/main/Jenkinsfile
    //depot/projA/main/src/...

ProjA>> dev
    //depot/projA/dev/Jenkinsfile
    //depot/projA/dev/src/...

An 'Includes' path for Branch Sources set to:  //depot/projA/...

Jenkins will now create two branches 'main' and 'dev'.

The default Mapping is '...' so the 'src/...' and any other files under the branch root will appear in the project's workspace.  To import an extenal location we can add another line to the mapping:

    ...
    //depot/external/stuff/...

Now both branches 'main' and 'dev' will have a folder 'depot/external/stuff' with the mapped files.  We can also use the `BRANCH_NAME` environment variable in the remote path uses the branch name.

   ...
   //depot/external/${BRANCH_NAME}/...

and in 'main' you will now see the remote files in ' depot/external/main' along with the local project files mapped with '...'
  • Files 8
  • Comments 0
8 edited 0 added 0 deleted
main/java/org/jenkinsci/plugins/p4/ConfigurationListener.java#13
Loading...
main/java/org/jenkinsci/plugins/p4/client/ViewMapHelper.java#5
Loading...
main/java/org/jenkinsci/plugins/p4/scm/BranchesScmSource.java#28
Loading...
main/java/org/jenkinsci/plugins/p4/scm/GlobalLibraryScmSource.java#17
Loading...
main/java/org/jenkinsci/plugins/p4/scm/GraphScmSource.java#19
Loading...
main/java/org/jenkinsci/plugins/p4/scm/SwarmScmSource.java#21
Loading...
main/java/org/jenkinsci/plugins/p4/workflow/source/AbstractSource.java#7
Loading...
test/java/org/jenkinsci/plugins/p4/scm/PerforceSCMSourceTest.java#15
Loading...
Tip: Use n and p to cycle through the changes.