SlideShare a Scribd company logo
1 of 37
Perforce Plugin for Jenkins
An introduction to the ‘P4’ Plugin and update
on the latest features.
Paul Allen – Perforce Software
© Perforce Software Inc. All Rights Reserved.
Paul Allen
Senior Integration Engineer
Perforce
© Perforce Software Inc. All Rights Reserved.
Introduction
◦ The Perfect Monorepo
◦ P4 plugin
◦ Credentials
◦ Workspace management
◦ Perforce Operations
◦ Polling, triggers and reviews
◦ P4 Groovy
The Perfect Monorepo
What is a Monorepo?
© Perforce Software Inc. All Rights Reserved.
One Repo to rule them all, One Repo to find them,
One Repo to bring them all and in the server bind them.
One Repo
© Perforce Software Inc. All Rights Reserved.
One Store
Store all sources, projects and sub projects;
even artifacts, tooling, docs and test reports...
© Perforce Software Inc. All Rights Reserved.
One History
Boldly go across source and time
Reproduce any source at any point in time
© Perforce Software Inc. All Rights Reserved.
Global Access
Any file any where
Fast Global Distribution
Fine grain protections
P4 Plugin
Perforce plugin support for Jenkins
© Perforce Software Inc. All Rights Reserved.
Disambiguation
◦ Community ‘Perforce’ plugin
https://wiki.jenkins-ci.org/display/JENKINS/Perforce+Plugin
◦ Perforce Supported ‘P4’ plugin
https://wiki.jenkins-ci.org/display/JENKINS/P4+Plugin
© Perforce Software Inc. All Rights Reserved.
The ‘P4’ plugin
◦ Why
Access the power of Perforce from within Jenkins
◦ P4Java
Pure Java solution
No ‘P4’ executable to install and keep up-to-date.
◦ Latest features
Streams, sync and clean up options
Credentials
Connecting to Perforce…
© Perforce Software Inc. All Rights Reserved.
Credentials
◦ Perforce Credentials
Shared Credentials
Managed from one location
Independent from the Job configuration
Update connection details in one location
◦ Credential Types
1. Perforce Password Credential
2. Perforce Ticket Credential
© Perforce Software Inc. All Rights Reserved.
Credentials
◦ Connection information
Username/Password
Perforce address and port
workshop.perforce.com:1666
◦ Password credentials
Username
Password
ID (useful to reference in the DSL)
Description
© Perforce Software Inc. All Rights Reserved.
Credentials
◦ Ticket based security
Perforce generated Ticket String
$ p4 login –p
4E034A8812F81B38229BF8FA62B0FEB1
Location of Perforce P4TICKET file
/home/pallen/.p4ticket
◦ SSL and Trust
Check the SSL box to add the ssl: part to P4PORT
Use p4 trust or click test to get the fingerprint
Workspace Management
Jenkins and Perforce Workspaces
© Perforce Software 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
© Perforce Software Inc. All Rights Reserved.
Workspaces
◦ Workspace Configuration
Streams Workspace
Manual Workspace
Template Workspace
Static Workspace (predefined)
Spec Workspace (spec depot or file)
workspace: [$class: 'StreamWorkspaceImpl',
charset: 'none',
format: 'jenkins-${NODE_NAME}-${JOB_NAME}',
pinHost: false,
streamName: '//streams/st1-main']
Perforce Operations
Checkout, Build and Post Build Steps
© Perforce Software Inc. All Rights Reserved.
CD Pipe
◦ SCM Operations
Artifact
SCM
{"id":[{"name":"bob"}
]}
CI Build pipeline
package main
import "fmt”
func main() {
@change @label@review
populate
unshelve
label
publish
© Perforce Software Inc. All Rights Reserved.
SCM Operations
◦ Populate p4sync / checkout
Synchronize the files in the Workspace prior to build.
◦ Unshelve p4unshelve
Unshelve code into the Workspace prior to build.
◦ Publish p4publish
Submit files back into Perforce, post build.
◦ Label p4tag
Automatic label against the populated files in the Workspace, post build.
© Perforce Software Inc. All Rights Reserved.
Populate
◦ Auto Cleanup and Sync
populate:[$class:'AutoCleanImpl',
delete:true, replace:true, modtime:false,
quiet:true, pin:''
]
◦ Force Clean and Sync
populate: [$class: 'ForceCleanImpl',
have:false, pin:'', quiet:true
]
© Perforce Software Inc. All Rights Reserved.
Unshelve
◦ Unshelve Build Step
Unshelve the change as a Build step defined in the Job
Files are unshelved and resolved prior build.
p4unshelve resolve:'at', shelf:'12345'
© Perforce Software Inc. All Rights Reserved.
Publish
◦ Shelve or Submit a change
◦ Connection & Workspace
◦ Use a narrow view
◦ Virtual stream
◦ Read/Write access for files
Set Workspace option ALLWRITE or use filetype +w
© Perforce Software Inc. All Rights Reserved.
Publish
p4publish credential:'phooey1666',
publish: [
$class:'SubmitImpl',
delete:false,
description:'Build: ${BUILD_TAG}',
onlyOnSuccess:false,
reopen:false],
workspace: [
$class:'StreamWorkspaceImpl',
charset:'none',
format:'jenkins-${JOB_NAME}-publish',
pinHost:false,
streamName:'//streams/st1-main']
© Perforce Software Inc. All Rights Reserved.
Label
◦ Automatic label
Label on success option
Uses Populate Client’s View
◦ Name & Description
p4tag rawLabelName:'${JOB_NAME}-passed',
rawLabelDesc:'''Jenkins job: ${JOB_NAME}
Jenkins build: ${BUILD_TAG}
Jenkins build date: ${BUILD_ID}
Jenkins build number: ${BUILD_NUMBER}'''
Polling, Triggers and Reviews
Still polling?
© Perforce Software Inc. All Rights Reserved.
Polling… if you must
◦ Polling build Filters
Exclude changes from Depot path
Exclude changes from user
Exclude changes outside view mask
Poll on Master using Latest Build
Polling per Change
◦ Workspace modes
Workspace to check the build - Preview check Only (sync –k)
© Perforce Software Inc. All Rights Reserved.
Triggers
◦ Perforce triggered build
◦ Subscribe Job (P4 Trigger)
curl --header 'Content-Type: application/json' 
--request POST 
--data "payload={change:200,p4port:"perforce.com:1666"}" 
http://jenkins:8080/p4/change
◦ Swarm (P4 Review)
Build triggered by Perforce Swarm.
Review or Change unshelved into workspace prior to build
© Perforce Software Inc. All Rights Reserved.
Swarm
[POST]
https://swarm:deadbeef@perforce.com:8443
/job/myJob/review/build
?change={change}&status={status}&review={review}
&pass={pass}&fail={fail}
P4 Groovy
P4 command access for Groovy
© Perforce Software Inc. All Rights Reserved.
P4Groovy
◦ P4Groovy object
Credential
Workspace
ws = [$class: 'StreamWorkspaceImpl',
charset: 'none', format: 'jenkins-${JOB_NAME}',
pinHost: false, streamName: '//streams/projAce']
p4 = p4(credential: 'phooey', workspace: ws)
© Perforce Software Inc. All Rights Reserved.
P4Groovy Methods
◦ Run
Requires: command, arguments (‘,’ separated String)
Returns: tagged output (specifically Map<String, Object>[])
p4.run(’changes', '-m5, //...')
◦ Getters
p4.getUserName()
p4.getClientName()
© Perforce Software Inc. All Rights Reserved.
P4Groovy Methods
◦ Fetch
Requires: spec type, spec id
Returns: a spec as a Map
client = p4.fetch(‘client’, ‘my_ws’)
◦ Save
Requires: spec type, the spec as a Map
Returns: tagged output (specifically Map<String, Object>[])
p4.save(‘client’, client)
© Perforce Software Inc. All Rights Reserved.
Example
◦ Combine Steps with P4Groovy
Populate is made up of several steps not just sync
Use P4Groove for custom operations e.g.
node() {
...
job = p4.fetch('job', 'job000006')
desc = job.get('Description')
desc = desc + env.BUILD_URL
job.put('Description', desc)
p4.save('job', job)
}
Thanks for Joining us!
End

More Related Content

What's hot

East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & ToolsEast Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
Gerke Max Preussner
 
RESTful services on IBM Domino/XWork
RESTful services on IBM Domino/XWorkRESTful services on IBM Domino/XWork
RESTful services on IBM Domino/XWork
John Dalsgaard
 

What's hot (20)

Cloud arch patterns
Cloud arch patternsCloud arch patterns
Cloud arch patterns
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
 
OpenStack Ironic - Bare Metal-as-a-Service
OpenStack Ironic - Bare Metal-as-a-ServiceOpenStack Ironic - Bare Metal-as-a-Service
OpenStack Ironic - Bare Metal-as-a-Service
 
Developing Automotive Linux
Developing Automotive LinuxDeveloping Automotive Linux
Developing Automotive Linux
 
Accelerating with Ansible
Accelerating with AnsibleAccelerating with Ansible
Accelerating with Ansible
 
Introduction to systemd
Introduction to systemdIntroduction to systemd
Introduction to systemd
 
Q4.11: Porting Android to new Platforms
Q4.11: Porting Android to new PlatformsQ4.11: Porting Android to new Platforms
Q4.11: Porting Android to new Platforms
 
Ansible
AnsibleAnsible
Ansible
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot images
 
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
Linux Training For Beginners | Linux Administration Tutorial | Introduction T...
 
Openstack Swift - Lots of small files
Openstack Swift - Lots of small filesOpenstack Swift - Lots of small files
Openstack Swift - Lots of small files
 
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & ToolsEast Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
East Coast DevCon 2014: The Slate UI Framework - Architecture & Tools
 
Page cache in Linux kernel
Page cache in Linux kernelPage cache in Linux kernel
Page cache in Linux kernel
 
Comparative Analysis of Windows and Linux System
Comparative Analysis of Windows and Linux SystemComparative Analysis of Windows and Linux System
Comparative Analysis of Windows and Linux System
 
Using Wildcards with rsyslog's File Monitor imfile
Using Wildcards with rsyslog's File Monitor imfileUsing Wildcards with rsyslog's File Monitor imfile
Using Wildcards with rsyslog's File Monitor imfile
 
RESTful services on IBM Domino/XWork
RESTful services on IBM Domino/XWorkRESTful services on IBM Domino/XWork
RESTful services on IBM Domino/XWork
 
Debian or Yocto Project? Which is the best for your Embedded Linux project?
Debian or Yocto Project? Which is the best for your Embedded Linux project?Debian or Yocto Project? Which is the best for your Embedded Linux project?
Debian or Yocto Project? Which is the best for your Embedded Linux project?
 
OpenStack DRaaS - Freezer - 101
OpenStack DRaaS - Freezer - 101OpenStack DRaaS - Freezer - 101
OpenStack DRaaS - Freezer - 101
 
Online game server on Akka.NET (NDC2016)
Online game server on Akka.NET (NDC2016)Online game server on Akka.NET (NDC2016)
Online game server on Akka.NET (NDC2016)
 
Ceph
CephCeph
Ceph
 

Viewers also liked

Infographic: Perforce vs Subversion
Infographic: Perforce vs SubversionInfographic: Perforce vs Subversion
Infographic: Perforce vs Subversion
Perforce
 
[AMD] Novel Use of Perforce for Software Auto-updates and File Transfer
[AMD] Novel Use of Perforce for Software Auto-updates and File Transfer[AMD] Novel Use of Perforce for Software Auto-updates and File Transfer
[AMD] Novel Use of Perforce for Software Auto-updates and File Transfer
Perforce
 
[IC Manage] Workspace Acceleration & Network Storage Reduction
[IC Manage] Workspace Acceleration & Network Storage Reduction[IC Manage] Workspace Acceleration & Network Storage Reduction
[IC Manage] Workspace Acceleration & Network Storage Reduction
Perforce
 
[SAP] Perforce Administrative Self Services at SAP
[SAP] Perforce Administrative Self Services at SAP[SAP] Perforce Administrative Self Services at SAP
[SAP] Perforce Administrative Self Services at SAP
Perforce
 
[NetApp Managing Big Workspaces with Storage Magic
[NetApp Managing Big Workspaces with Storage Magic[NetApp Managing Big Workspaces with Storage Magic
[NetApp Managing Big Workspaces with Storage Magic
Perforce
 
[Citrix] Perforce Standardisation at Citrix
[Citrix] Perforce Standardisation at Citrix[Citrix] Perforce Standardisation at Citrix
[Citrix] Perforce Standardisation at Citrix
Perforce
 
[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure
Perforce
 
Infographic: Perforce vs ClearCase
Infographic: Perforce vs ClearCaseInfographic: Perforce vs ClearCase
Infographic: Perforce vs ClearCase
Perforce
 
[NetherRealm Studios] Game Studio Perforce Architecture
[NetherRealm Studios] Game Studio Perforce Architecture[NetherRealm Studios] Game Studio Perforce Architecture
[NetherRealm Studios] Game Studio Perforce Architecture
Perforce
 

Viewers also liked (20)

Streams in Parallel Development by Sven Erik Knop
Streams in Parallel Development by Sven Erik KnopStreams in Parallel Development by Sven Erik Knop
Streams in Parallel Development by Sven Erik Knop
 
Single Source of Truth in a Distributed World by Sven Erik Knop
Single Source of Truth in a Distributed World by Sven Erik KnopSingle Source of Truth in a Distributed World by Sven Erik Knop
Single Source of Truth in a Distributed World by Sven Erik Knop
 
Perforce - Under New Management by Konrad Litwin
Perforce - Under New Management by Konrad LitwinPerforce - Under New Management by Konrad Litwin
Perforce - Under New Management by Konrad Litwin
 
ClearCase Escape Plan
ClearCase Escape PlanClearCase Escape Plan
ClearCase Escape Plan
 
Are You a Female Misogynist?
Are You a Female Misogynist?Are You a Female Misogynist?
Are You a Female Misogynist?
 
How Samsung Engineers Do Pre-Commit Builds with Perforce Helix Streams
How Samsung Engineers Do Pre-Commit Builds with Perforce Helix StreamsHow Samsung Engineers Do Pre-Commit Builds with Perforce Helix Streams
How Samsung Engineers Do Pre-Commit Builds with Perforce Helix Streams
 
Infographic: Perforce vs Subversion
Infographic: Perforce vs SubversionInfographic: Perforce vs Subversion
Infographic: Perforce vs Subversion
 
[AMD] Novel Use of Perforce for Software Auto-updates and File Transfer
[AMD] Novel Use of Perforce for Software Auto-updates and File Transfer[AMD] Novel Use of Perforce for Software Auto-updates and File Transfer
[AMD] Novel Use of Perforce for Software Auto-updates and File Transfer
 
[IC Manage] Workspace Acceleration & Network Storage Reduction
[IC Manage] Workspace Acceleration & Network Storage Reduction[IC Manage] Workspace Acceleration & Network Storage Reduction
[IC Manage] Workspace Acceleration & Network Storage Reduction
 
[SAP] Perforce Administrative Self Services at SAP
[SAP] Perforce Administrative Self Services at SAP[SAP] Perforce Administrative Self Services at SAP
[SAP] Perforce Administrative Self Services at SAP
 
[NetApp Managing Big Workspaces with Storage Magic
[NetApp Managing Big Workspaces with Storage Magic[NetApp Managing Big Workspaces with Storage Magic
[NetApp Managing Big Workspaces with Storage Magic
 
Continuous Validation
Continuous ValidationContinuous Validation
Continuous Validation
 
[Webinar] The Changing Role of Release Engineering in a DevOps World with J. ...
[Webinar] The Changing Role of Release Engineering in a DevOps World with J. ...[Webinar] The Changing Role of Release Engineering in a DevOps World with J. ...
[Webinar] The Changing Role of Release Engineering in a DevOps World with J. ...
 
Cheat Sheet
Cheat SheetCheat Sheet
Cheat Sheet
 
[Citrix] Perforce Standardisation at Citrix
[Citrix] Perforce Standardisation at Citrix[Citrix] Perforce Standardisation at Citrix
[Citrix] Perforce Standardisation at Citrix
 
[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure[MathWorks] Versioning Infrastructure
[MathWorks] Versioning Infrastructure
 
Infographic: Perforce vs ClearCase
Infographic: Perforce vs ClearCaseInfographic: Perforce vs ClearCase
Infographic: Perforce vs ClearCase
 
[NetherRealm Studios] Game Studio Perforce Architecture
[NetherRealm Studios] Game Studio Perforce Architecture[NetherRealm Studios] Game Studio Perforce Architecture
[NetherRealm Studios] Game Studio Perforce Architecture
 
Granular Protections Management with Triggers
Granular Protections Management with TriggersGranular Protections Management with Triggers
Granular Protections Management with Triggers
 
How Continuous Delivery Helped McKesson Create Award Winning Applications
How Continuous Delivery Helped McKesson Create Award Winning ApplicationsHow Continuous Delivery Helped McKesson Create Award Winning Applications
How Continuous Delivery Helped McKesson Create Award Winning Applications
 

Similar to Perfecting Your Development Tools: Updates to the Helix Plugin for Jenkins

Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009
Helgi Þormar Þorbjörnsson
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps Approach
Akshaya Mahapatra
 

Similar to Perfecting Your Development Tools: Updates to the Helix Plugin for Jenkins (20)

Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009Website releases made easy with the PEAR installer, OSCON 2009
Website releases made easy with the PEAR installer, OSCON 2009
 
Vikash_Kr_Singh_CV
Vikash_Kr_Singh_CVVikash_Kr_Singh_CV
Vikash_Kr_Singh_CV
 
Performance Profiling in Rust
Performance Profiling in RustPerformance Profiling in Rust
Performance Profiling in Rust
 
eZ Platform Cloud and eZ Launchpad: Don’t Host, Don’t Deploy, Don’t Install—J...
eZ Platform Cloud and eZ Launchpad: Don’t Host, Don’t Deploy, Don’t Install—J...eZ Platform Cloud and eZ Launchpad: Don’t Host, Don’t Deploy, Don’t Install—J...
eZ Platform Cloud and eZ Launchpad: Don’t Host, Don’t Deploy, Don’t Install—J...
 
eZ Platform Cloud and eZ Launchpad: Don’t Host, Don’t Deploy, Don’t Install—J...
eZ Platform Cloud and eZ Launchpad: Don’t Host, Don’t Deploy, Don’t Install—J...eZ Platform Cloud and eZ Launchpad: Don’t Host, Don’t Deploy, Don’t Install—J...
eZ Platform Cloud and eZ Launchpad: Don’t Host, Don’t Deploy, Don’t Install—J...
 
Building JBoss AS 7 for Fedora
Building JBoss AS 7 for FedoraBuilding JBoss AS 7 for Fedora
Building JBoss AS 7 for Fedora
 
Belvedere
BelvedereBelvedere
Belvedere
 
Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
Alfresco sdk 2.0
Alfresco sdk 2.0Alfresco sdk 2.0
Alfresco sdk 2.0
 
DevOps in PHP environment
DevOps in PHP environment DevOps in PHP environment
DevOps in PHP environment
 
A General Purpose Docker Image for PHP
A General Purpose Docker Image for PHPA General Purpose Docker Image for PHP
A General Purpose Docker Image for PHP
 
Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015Ansible is the simplest way to automate. SymfonyCafe, 2015
Ansible is the simplest way to automate. SymfonyCafe, 2015
 
Xebia labsperforce final
Xebia labsperforce finalXebia labsperforce final
Xebia labsperforce final
 
Transferring Changes Between Perforce Servers
Transferring Changes Between Perforce ServersTransferring Changes Between Perforce Servers
Transferring Changes Between Perforce Servers
 
Installing and Getting Started with Alfresco
Installing and Getting Started with AlfrescoInstalling and Getting Started with Alfresco
Installing and Getting Started with Alfresco
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps Approach
 
DCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production ParityDCRUG: Achieving Development-Production Parity
DCRUG: Achieving Development-Production Parity
 
Api Design
Api DesignApi Design
Api Design
 
Deployment Tactics
Deployment TacticsDeployment Tactics
Deployment Tactics
 
InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018InSpec Workshop at Velocity London 2018
InSpec Workshop at Velocity London 2018
 

More from Perforce

More from Perforce (20)

How to Organize Game Developers With Different Planning Needs
How to Organize Game Developers With Different Planning NeedsHow to Organize Game Developers With Different Planning Needs
How to Organize Game Developers With Different Planning Needs
 
Regulatory Traceability: How to Maintain Compliance, Quality, and Cost Effic...
Regulatory Traceability:  How to Maintain Compliance, Quality, and Cost Effic...Regulatory Traceability:  How to Maintain Compliance, Quality, and Cost Effic...
Regulatory Traceability: How to Maintain Compliance, Quality, and Cost Effic...
 
Efficient Security Development and Testing Using Dynamic and Static Code Anal...
Efficient Security Development and Testing Using Dynamic and Static Code Anal...Efficient Security Development and Testing Using Dynamic and Static Code Anal...
Efficient Security Development and Testing Using Dynamic and Static Code Anal...
 
Understanding Compliant Workflow Enforcement SOPs
Understanding Compliant Workflow Enforcement SOPsUnderstanding Compliant Workflow Enforcement SOPs
Understanding Compliant Workflow Enforcement SOPs
 
Branching Out: How To Automate Your Development Process
Branching Out: How To Automate Your Development ProcessBranching Out: How To Automate Your Development Process
Branching Out: How To Automate Your Development Process
 
How to Do Code Reviews at Massive Scale For DevOps
How to Do Code Reviews at Massive Scale For DevOpsHow to Do Code Reviews at Massive Scale For DevOps
How to Do Code Reviews at Massive Scale For DevOps
 
How to Spark Joy In Your Product Backlog
How to Spark Joy In Your Product Backlog How to Spark Joy In Your Product Backlog
How to Spark Joy In Your Product Backlog
 
Going Remote: Build Up Your Game Dev Team
Going Remote: Build Up Your Game Dev Team Going Remote: Build Up Your Game Dev Team
Going Remote: Build Up Your Game Dev Team
 
Shift to Remote: How to Manage Your New Workflow
Shift to Remote: How to Manage Your New WorkflowShift to Remote: How to Manage Your New Workflow
Shift to Remote: How to Manage Your New Workflow
 
Hybrid Development Methodology in a Regulated World
Hybrid Development Methodology in a Regulated WorldHybrid Development Methodology in a Regulated World
Hybrid Development Methodology in a Regulated World
 
Better, Faster, Easier: How to Make Git Really Work in the Enterprise
Better, Faster, Easier: How to Make Git Really Work in the EnterpriseBetter, Faster, Easier: How to Make Git Really Work in the Enterprise
Better, Faster, Easier: How to Make Git Really Work in the Enterprise
 
Easier Requirements Management Using Diagrams In Helix ALM
Easier Requirements Management Using Diagrams In Helix ALMEasier Requirements Management Using Diagrams In Helix ALM
Easier Requirements Management Using Diagrams In Helix ALM
 
How To Master Your Mega Backlog
How To Master Your Mega Backlog How To Master Your Mega Backlog
How To Master Your Mega Backlog
 
Achieving Software Safety, Security, and Reliability Part 3: What Does the Fu...
Achieving Software Safety, Security, and Reliability Part 3: What Does the Fu...Achieving Software Safety, Security, and Reliability Part 3: What Does the Fu...
Achieving Software Safety, Security, and Reliability Part 3: What Does the Fu...
 
How to Scale With Helix Core and Microsoft Azure
How to Scale With Helix Core and Microsoft Azure How to Scale With Helix Core and Microsoft Azure
How to Scale With Helix Core and Microsoft Azure
 
Achieving Software Safety, Security, and Reliability Part 2
Achieving Software Safety, Security, and Reliability Part 2Achieving Software Safety, Security, and Reliability Part 2
Achieving Software Safety, Security, and Reliability Part 2
 
Should You Break Up With Your Monolith?
Should You Break Up With Your Monolith?Should You Break Up With Your Monolith?
Should You Break Up With Your Monolith?
 
Achieving Software Safety, Security, and Reliability Part 1: Common Industry ...
Achieving Software Safety, Security, and Reliability Part 1: Common Industry ...Achieving Software Safety, Security, and Reliability Part 1: Common Industry ...
Achieving Software Safety, Security, and Reliability Part 1: Common Industry ...
 
What's New in Helix ALM 2019.4
What's New in Helix ALM 2019.4What's New in Helix ALM 2019.4
What's New in Helix ALM 2019.4
 
Free Yourself From the MS Office Prison
Free Yourself From the MS Office Prison Free Yourself From the MS Office Prison
Free Yourself From the MS Office Prison
 

Recently uploaded

%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Recently uploaded (20)

%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 

Perfecting Your Development Tools: Updates to the Helix Plugin for Jenkins

  • 1. Perforce Plugin for Jenkins An introduction to the ‘P4’ Plugin and update on the latest features. Paul Allen – Perforce Software
  • 2. © Perforce Software Inc. All Rights Reserved. Paul Allen Senior Integration Engineer Perforce
  • 3. © Perforce Software Inc. All Rights Reserved. Introduction ◦ The Perfect Monorepo ◦ P4 plugin ◦ Credentials ◦ Workspace management ◦ Perforce Operations ◦ Polling, triggers and reviews ◦ P4 Groovy
  • 4. The Perfect Monorepo What is a Monorepo?
  • 5. © Perforce Software Inc. All Rights Reserved. One Repo to rule them all, One Repo to find them, One Repo to bring them all and in the server bind them. One Repo
  • 6. © Perforce Software Inc. All Rights Reserved. One Store Store all sources, projects and sub projects; even artifacts, tooling, docs and test reports...
  • 7. © Perforce Software Inc. All Rights Reserved. One History Boldly go across source and time Reproduce any source at any point in time
  • 8. © Perforce Software Inc. All Rights Reserved. Global Access Any file any where Fast Global Distribution Fine grain protections
  • 9. P4 Plugin Perforce plugin support for Jenkins
  • 10. © Perforce Software Inc. All Rights Reserved. Disambiguation ◦ Community ‘Perforce’ plugin https://wiki.jenkins-ci.org/display/JENKINS/Perforce+Plugin ◦ Perforce Supported ‘P4’ plugin https://wiki.jenkins-ci.org/display/JENKINS/P4+Plugin
  • 11. © Perforce Software Inc. All Rights Reserved. The ‘P4’ plugin ◦ Why Access the power of Perforce from within Jenkins ◦ P4Java Pure Java solution No ‘P4’ executable to install and keep up-to-date. ◦ Latest features Streams, sync and clean up options
  • 13. © Perforce Software Inc. All Rights Reserved. Credentials ◦ Perforce Credentials Shared Credentials Managed from one location Independent from the Job configuration Update connection details in one location ◦ Credential Types 1. Perforce Password Credential 2. Perforce Ticket Credential
  • 14. © Perforce Software Inc. All Rights Reserved. Credentials ◦ Connection information Username/Password Perforce address and port workshop.perforce.com:1666 ◦ Password credentials Username Password ID (useful to reference in the DSL) Description
  • 15. © Perforce Software Inc. All Rights Reserved. Credentials ◦ Ticket based security Perforce generated Ticket String $ p4 login –p 4E034A8812F81B38229BF8FA62B0FEB1 Location of Perforce P4TICKET file /home/pallen/.p4ticket ◦ SSL and Trust Check the SSL box to add the ssl: part to P4PORT Use p4 trust or click test to get the fingerprint
  • 16. Workspace Management Jenkins and Perforce Workspaces
  • 17. © Perforce Software 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
  • 18. © Perforce Software Inc. All Rights Reserved. Workspaces ◦ Workspace Configuration Streams Workspace Manual Workspace Template Workspace Static Workspace (predefined) Spec Workspace (spec depot or file) workspace: [$class: 'StreamWorkspaceImpl', charset: 'none', format: 'jenkins-${NODE_NAME}-${JOB_NAME}', pinHost: false, streamName: '//streams/st1-main']
  • 19. Perforce Operations Checkout, Build and Post Build Steps
  • 20. © Perforce Software Inc. All Rights Reserved. CD Pipe ◦ SCM Operations Artifact SCM {"id":[{"name":"bob"} ]} CI Build pipeline package main import "fmt” func main() { @change @label@review populate unshelve label publish
  • 21. © Perforce Software Inc. All Rights Reserved. SCM Operations ◦ Populate p4sync / checkout Synchronize the files in the Workspace prior to build. ◦ Unshelve p4unshelve Unshelve code into the Workspace prior to build. ◦ Publish p4publish Submit files back into Perforce, post build. ◦ Label p4tag Automatic label against the populated files in the Workspace, post build.
  • 22. © Perforce Software Inc. All Rights Reserved. Populate ◦ Auto Cleanup and Sync populate:[$class:'AutoCleanImpl', delete:true, replace:true, modtime:false, quiet:true, pin:'' ] ◦ Force Clean and Sync populate: [$class: 'ForceCleanImpl', have:false, pin:'', quiet:true ]
  • 23. © Perforce Software Inc. All Rights Reserved. Unshelve ◦ Unshelve Build Step Unshelve the change as a Build step defined in the Job Files are unshelved and resolved prior build. p4unshelve resolve:'at', shelf:'12345'
  • 24. © Perforce Software Inc. All Rights Reserved. Publish ◦ Shelve or Submit a change ◦ Connection & Workspace ◦ Use a narrow view ◦ Virtual stream ◦ Read/Write access for files Set Workspace option ALLWRITE or use filetype +w
  • 25. © Perforce Software Inc. All Rights Reserved. Publish p4publish credential:'phooey1666', publish: [ $class:'SubmitImpl', delete:false, description:'Build: ${BUILD_TAG}', onlyOnSuccess:false, reopen:false], workspace: [ $class:'StreamWorkspaceImpl', charset:'none', format:'jenkins-${JOB_NAME}-publish', pinHost:false, streamName:'//streams/st1-main']
  • 26. © Perforce Software Inc. All Rights Reserved. Label ◦ Automatic label Label on success option Uses Populate Client’s View ◦ Name & Description p4tag rawLabelName:'${JOB_NAME}-passed', rawLabelDesc:'''Jenkins job: ${JOB_NAME} Jenkins build: ${BUILD_TAG} Jenkins build date: ${BUILD_ID} Jenkins build number: ${BUILD_NUMBER}'''
  • 27. Polling, Triggers and Reviews Still polling?
  • 28. © Perforce Software Inc. All Rights Reserved. Polling… if you must ◦ Polling build Filters Exclude changes from Depot path Exclude changes from user Exclude changes outside view mask Poll on Master using Latest Build Polling per Change ◦ Workspace modes Workspace to check the build - Preview check Only (sync –k)
  • 29. © Perforce Software Inc. All Rights Reserved. Triggers ◦ Perforce triggered build ◦ Subscribe Job (P4 Trigger) curl --header 'Content-Type: application/json' --request POST --data "payload={change:200,p4port:"perforce.com:1666"}" http://jenkins:8080/p4/change ◦ Swarm (P4 Review) Build triggered by Perforce Swarm. Review or Change unshelved into workspace prior to build
  • 30. © Perforce Software Inc. All Rights Reserved. Swarm [POST] https://swarm:deadbeef@perforce.com:8443 /job/myJob/review/build ?change={change}&status={status}&review={review} &pass={pass}&fail={fail}
  • 31. P4 Groovy P4 command access for Groovy
  • 32. © Perforce Software Inc. All Rights Reserved. P4Groovy ◦ P4Groovy object Credential Workspace ws = [$class: 'StreamWorkspaceImpl', charset: 'none', format: 'jenkins-${JOB_NAME}', pinHost: false, streamName: '//streams/projAce'] p4 = p4(credential: 'phooey', workspace: ws)
  • 33. © Perforce Software Inc. All Rights Reserved. P4Groovy Methods ◦ Run Requires: command, arguments (‘,’ separated String) Returns: tagged output (specifically Map<String, Object>[]) p4.run(’changes', '-m5, //...') ◦ Getters p4.getUserName() p4.getClientName()
  • 34. © Perforce Software Inc. All Rights Reserved. P4Groovy Methods ◦ Fetch Requires: spec type, spec id Returns: a spec as a Map client = p4.fetch(‘client’, ‘my_ws’) ◦ Save Requires: spec type, the spec as a Map Returns: tagged output (specifically Map<String, Object>[]) p4.save(‘client’, client)
  • 35. © Perforce Software Inc. All Rights Reserved. Example ◦ Combine Steps with P4Groovy Populate is made up of several steps not just sync Use P4Groove for custom operations e.g. node() { ... job = p4.fetch('job', 'job000006') desc = job.get('Description') desc = desc + env.BUILD_URL job.put('Description', desc) p4.save('job', job) }
  • 37. End

Editor's Notes

  1. What makes the perfect monorepo The P4 Plugin …
  2. No storage limits Any size any type, users with Petabytes of data
  3. Cross project Mapping, map any file from any repo in your view. Global sequential identifier Global change number across all repos; sequential so you know what happened when
  4. Global distribution Distributed replicas (edge/commit) and build servers, not to forget proxies (some sites proxies per-switch per-floor) Fine grain protection Any level, from none to fully encrypted traffic. Access level as fine as you like even down to the individual file and restricted to user/group IP even proxy. Distributed Client Little known fact that we have DVCS support built in. Take any portion of the server and its history off-line and push you changes back later.
  5. The P4 plugin was designed to allow you to access all the power of the Perforce MonoRepo. Allowing Jenkins to fetch source and artifacts from Perforce and version the resulting build artifacts
  6. 20minutes here
  7. share - appears in the workspace and you can submit and integrate to the parent isolate - appears in the workspace and you can submit, isolated from parent import - appears in the workspace only, cannot submit changes (import+) exclude - will not appear in the workspace, cannot get submitted
  8. Preview Check Only – sync -k to trigger polling Sync Only – no cleanup