1 Optimizing the Jenkins Pipeline a DSL for Greasing the CD machine
Who am I? Robert Cowham Senior Consultant Perforce Software, Inc 2
Agenda Continuous Delivery and Pipelines Perforce Helix Introduction Perforce Plugin Revisited Path to a workflow DSL 3
Why can t we release faster? Dev QA Pre Production Production Lack of communication between teams Each team uses a different data repository Environments can be substantially different Software deployed in different ways for each environment
Continuous Delivery Deliver working product to users as quickly as possible Every change (check-in) leads to a potential release Give business the option to release what, when, to whom A change in process, and culture Continuous Delivery PIPELINE Reqs Dev Test Integrate Deploy 5
Best practices for success Team Collaboration Flexible Workflow Complete Visibility COORDINATE TEAMS (design, dev, release, devops, etc.) PIPELINE COORDINATE ASSETS (code, scripts, artwork, binaries, etc.) Version Everything Universal Security Detailed History
Perforce Helix An introduction
Managing IP for market leaders Chips Games & Animation Cloud/SW Electronics Systems Automotive 9,500 users 500+ terabytes 5,000+ users coders & designers 10,000,000 Perforce xact/day 13,000 à 20,000 users Everything! 11,000+ users
Perforce Helix Consumers Flexible Workflows Version control, code reviews, simple file sharing Fast and Scalable From 10 to 10,000+ users Every File Efficiently handles large, often binary, data Everywhere Supports geographically distributed teams Contributors Secure Granular permissions, theft risk monitoring Open and Extensible APIs and integration hooks for customization
Perforce Helix enables Continuous Delivery Swarm Commons Insights End-to-end Collaboration Developer Collaboration Design Collaboration Development Analytics PIPELINE Reqs Dev Test Integrate Deploy Unified Asset Versioning Perforce Version Management DEV DEV HQ MFG 100s of Terabytes Globally Distributed DVCS Any File Type
Jenkins P4 Plugin
Jenkins P4 (Perforce) Plugin P4 Plugin (not Perforce Plugin) 100% Java (no dependency on P4 executable) Developed and supported by Perforce Extended capabilities 12
Capabilities Perforce authentication (credentials) Perforce workspace management Synchronization behavior Polling and filtered builds External review tools (Swarm) Change-list browsing Labeling builds (Tagging) External repository browsers (P4Web, Swarm) Submit assets back to Perforce (Publish) 13
Continuous Delivery Demo 14
Demo environment VM stores Helix P4D for code and artifacts Helix Swarm for review Jenkins for pipeline Docker image deployed to QA and Production environments
Demo scenario web app Edit the slider to include two more photos and deliver to production using the Continuous Delivery pipeline
Our pipeline Auto Auto Manual Application checked out, built and checked back in and labeled Artifacts retrieved from Perforce and build into docker container and checked back in Docker container deployed to QA for testing Docker container deployed to production for testing
Versioning pipeline artifacts Perforce can store data of any type and size. In this demo scenario Application Source SQL Scripts Graphics Files Build Artifacts Deployment images Environment Definitions Infrastructure as code
Developer workflow Working with files is optimized for Continuous Delivery Select stream to work from and start working Sync only the content needed for a task Code committed to trunk
Continuous code reviews Pre and post-commit code (& doc) reviews across lifecycle Inline conversations and diffs Built-in hooks for pre-flight testing and deployment Dashboard for continuous delivery across multiple projects Across Git and Perforce
Successful Implementation of a Continuous Delivery Pipeline Integrate Build Test Deploy Release High velocity build, test and deploy lifecycle Version Control Increased developer onus, unbreakable builds No room for it works on my machine Builds tested on production like environments Deployment to internal or external users
Workflow DSL Support for Workflow Plugin via DSL checkout([$class: 'PerforceScm', credential: '634a31d2-bd60-4c39- bf84-b09f057c5431', populate: [$class: 'AutoCleanImpl', delete: true, modtime: false, pin: '', quiet: true, replace: true], workspace: [$class: 'StreamWorkspaceImpl', charset: 'none', format: 'jenkins-${node_name}-${job_name}', pinhost: false, streamname: '//stream/main']]) p4sync credential: '634a31d2-bd60-4c39-bf84-b09f057c5431', stream: '//stream/main' 22
Snippet Generator 23
Additional support p4tag - Label build sources p4publish - Submit artifacts back to Perforce 24
Conclusion Perforce Helix: Foundation of Continuous Delivery Jenkins: Pipeline that delivers Continuous Delivery P4 Plugin: Glue between Helix and Jenkins Soon: full support of the workflow plugin with DSL 25
Please Share Your Feedback Did you find this session valuable? Please share your thoughts in the Jenkins User Conference Mobile App. Find the session in the app and click on the feedback area. 26