Perforce Birds of a Feather An introduction to
Perforce Birds of a Feather An introduction to the ‘P 4’ Plugin and update on the latest features. Paul Allen – Perforce Software 2016 #Jenkins. World
Introduction ◦ ◦ ◦ The Perfect Monorepo P 4 plugin Getting started Workspace management Polling, triggers and reviews P 4 Groovy
The Perfect Monorepo What is a Monorepo? © 2016 Cloud. Bees, Inc. All Rights Reserved
One Repo The Monorepo One Repo to rule them all, One Repo to find them, One Repo to bring them all and in the server bind them. © 2016 Cloud. Bees, Inc. All Rights Reserved
The Monorepo Store all sources, projects and sub projects; even artifacts, tooling, docs and test reports. . . All in one place, but accessible everywhere
Source. Time Build a view across source and time Reproduce any source at any point in time
Global Access Fast access across the global Fine grain protections
P 4 Plugin Perforce plugin support for Jenkins © 2016 Cloud. Bees, Inc. All Rights Reserved
Disambiguation ◦ Community ‘Perforce’ plugin https: //wiki. jenkins-ci. org/display/JENKINS/Perforce+Plugin ◦ Perforce Supported ‘P 4’ plugin https: //wiki. jenkins-ci. org/display/JENKINS/P 4+Plugin
The ‘P 4’ plugin ◦ Why Efficient use of Perforce to reduce server load. ◦ P 4 Java Pure Java solution No ‘P 4’ executable to install and keep up-to-date. ◦ Latest features Streams, sync and clean up options
Getting started First the basics… © 2016 Cloud. Bees, Inc. All Rights Reserved
Getting started ◦ Configure a basic connection ◦ Managing Workspaces ◦ Source code management All from the perspective of Jenkins Freestyle Job and Pipeline DSL
Credentials ◦ Connection information Perforce address and port workshop. perforce. com: 1666 ◦ Password credentials Username Password ID (useful to reference in the DSL) Description
Credentials ◦ Ticket based security Perforce generated Ticket String $ p 4 login –p 4 E 034 A 8812 F 81 B 38229 BF 8 FA 62 B 0 FEB 1 Location of Perforce P 4 TICKET file /home/pallen/. p 4 ticket ◦ SSL and Trust Check the SSL box to add the ssl: part to P 4 PORT Use p 4 trust or click test to get the fingerprint
Workspace Management Jenkins and Perforce Workspaces © 2016 Cloud. Bees, Inc. All Rights Reserved
Workspaces ◦ Jenkins workspace Location of files (on the master or slave) for Jenkins to build ◦ Perforce workspace Location where Perforce will manage the versioned an non-versioned files ◦ Shared root Recommend Perforce and Jenkins workspaces share the same root One Jenkins workspace to map to one Perforce workspace
Workspace View Mapping +---Ace. Project | +---src | +---test | +---docs | +---libs +---Blast. Project | +---src | +---test | +---docs | +---libs | | +---blast. jar //depot/Ace. Project/. . . -//depot/Ace. Project/docs/. . . -//depot/Ace. Project/libs/. . . //depot/Blast. Project/libs/. . .
Workspace //depot/Ace. Project/. . . //{client}/Ace/. . . -//depot/Ace. Project/docs/. . . -//depot/Ace. Project/libs/. . . -//{client}/Ace/docs/. . . -//(client}/Ace/libs/. . . //depot/Blast. Project/libs/. . . //{client}/Ace/plugins/. . .
Workspace Perforce workspace +---Ace. Project | +---src | +---test | +---docs | +---libs +---Blast. Project | +---src | +---test | +---docs | +---libs | | +---blast. jar Jenkins Workspace +---Ace | +---src | +---test | | | +---plugins | | | | +---blast. jar
Variable expansion
SCM Stages ◦ Populate ◦ Label ◦ Publish
Populate ◦ Auto ◦ Force Clean
Label ◦ Automatic label ◦ View ◦ Description ◦ Label on success
Publish ◦ Workspace setup ◦ Narrow views ◦ Read/Write access ◦ Virtual streams
Polling, Triggers and Reviews Still polling? © 2016 Cloud. Bees, Inc. All Rights Reserved
Polling vs Triggers ◦ Pin ◦ Filter ◦ Incremental builds
Swarm Reviews ◦ Configuration ◦ Callbacks ◦ Browsing
Classic Jobs ◦Walkthrough or demo
Pipeline ◦ Walkthrough or demo
P 4 Groovy P 4 command access for Groovy © 2016 Cloud. Bees, Inc. All Rights Reserved
P 4 Groovy ◦Walkthrough or demo
Questions
© 2016 Cloud. Bees, Inc. All Rights Reserved 201 6 #Jenkins. World
- Slides: 33