Build Trust in Your Build-to-Deployment Flow! Baruch - - PowerPoint PPT Presentation
Build Trust in Your Build-to-Deployment Flow! Baruch - - PowerPoint PPT Presentation
Build Trust in Your Build-to-Deployment Flow! Baruch Sadogursky, JFrog About me Baruch Sadogursky Developer Advocate @JFrog > Job definition (part of): Hang out with the
ü Baruch Sadogursky ü Developer Advocate @JFrog
> Job definition (part of): Hang out with the DevOps guys
ü @jbaruch
2 ¡
About me
QCon ¡London ¡2012 ¡
ü The cloud silver bullet ü The right tool for the job ü Binaries all the way ü The black magic
- f releasing
Agenda
QCon ¡London ¡2012 ¡ 3 ¡
EVERYTHING ¡*aaS ¡
The ¡New ¡Silver ¡Bullet ¡
Why We Need *aaS?
ü *aaS features Continuous Delivery
QCon ¡London ¡2012 ¡ 5 ¡
ü Advantages for the user:
> Always on the latest version
ü Advantages for the ISV:
> Agile > Rapid feedback > Users are the best beta-testers > No long-term support
ü Everybody Wins?
6 ¡
Continuous Delivery FTW
QCon ¡London ¡2012 ¡
Almost, except DevOps
ü Very frequent releases ü More than one version in production ü Complicated access levels
7 ¡ QCon ¡London ¡2012 ¡
Almost, except DevOps
ü Very frequent releases ü More than one version in production ü Complicated access levels
8 ¡ QCon ¡London ¡2012 ¡
Almost, except DevOps
ü Root cause analysis
> Trace from binaries to sources > Reproduction abilities
ü Promotions
> Status changes
9 ¡ QCon ¡London ¡2012 ¡
Almost, except DevOps
ü Root cause analysis
> Trace from binaries to sources > Reproduction abilities
ü Promotions
> Status changes
10 ¡ QCon ¡London ¡2012 ¡
Sounds Familiar?
ü Agile principles applied for DevOps ü We have good tooling for Agile development
> Version Control > Unit Testing (and coverage) > Build Servers > Hot Swap tools
ü What’s up with tooling for Agile DevOps?
11 ¡ QCon ¡London ¡2012 ¡
Agile Tooling for DevOps Checklist
ü Versioning ü Access control ü Traceability ü Promotions ü Tags and annotations ü Search
12 ¡ QCon ¡London ¡2012 ¡
How Do I Know?
ü JFrog SaaS offering
> Artifactory Online
ü We build, release and eat our own dog food
> Continuously
13 ¡ QCon ¡London ¡2012 ¡
HERE ¡COMES ¡BINARY ¡REPOSITORY ¡
The ¡Right ¡Tool ¡for ¡the ¡Job ¡
Here Comes Binary Repository
ü E.g. Artifactory ü Main feature – Smart Storage ü Much more than passive storage ü Critical for CI and ALM
15 ¡ QCon ¡London ¡2012 ¡
Tooling Chain
QCon ¡London ¡2012 ¡ 16 ¡
Artifactory in DevOps Ecosystem
17 ¡ QCon ¡London ¡2012 ¡
DEMO ¡TIME! ¡
Meet ¡ArRfactory ¡
Binaries All the Way
ü From some point product in your lifecycle, all you care about is binaries ü Lots of things to do after the software is built
QCon ¡London ¡2012 ¡ 19 ¡
The Release Pipeline
Source: ¡Agile ¡ALM, ¡Michael ¡Hü4ermann, ¡Manning ¡Publica9ons ¡Co. ¡ ¡
20 ¡ QCon ¡London ¡2012 ¡
Passing the software to QA
ü Different access rights ü Different physical location ü Ability to annotate
QCon ¡London ¡2012 ¡ 21 ¡
Staging and Preproduction
ü Replication of Production environment
> Lock versions of dependencies and artifacts
ü Allow access to set of users
QCon ¡London ¡2012 ¡ 22 ¡
Going to Production
ü Convert staging binaries to production ü Allow public access ü Change settings ü Tag
QCon ¡London ¡2012 ¡ 23 ¡
Traceability
ü Binaries should be traceable in every stage
> Sources > Dependencies > Environment details > Tags
ü Where’s the information?
> Version Control System > Build Server
QCon ¡London ¡2012 ¡ 24 ¡
WHAT ¡MY ¡FRIENDS ¡THINK ¡I ¡DO ¡
DevOps ¡
What Others Think I Do
QCon ¡London ¡2012 ¡ 26 ¡
What I Think I Do
QCon ¡London ¡2012 ¡ 27 ¡
What I Really Do
QCon ¡London ¡2012 ¡ 28 ¡
What I should Do
QCon ¡London ¡2012 ¡ 29 ¡
Target: Automation
ü It’s impossible to release frequently with manual procedures
> While maintaining quality
ü Use your binaries storage to release
QCon ¡London ¡2012 ¡ 30 ¡
THE ¡MAGIC ¡OF ¡RELEASE ¡
Put ¡your ¡repository ¡to ¡work ¡
Release With Release Candidate
ü Your next build is release-candidate ü Once successfully built and tested, click the button
> Automatic versions switch
› From integration to release
> Right place to put your binaries
› Move from Staging to Public
> Automatic VCS tagging for the release
QCon ¡London ¡2012 ¡ 32 ¡
Release With Release Candidate
ü Process:
- 1. Produce and build snapshots until satisfied
- 2. Once satisfied, build release candidate
- 3. Stage RC, check and verify
- 4. Once checked, release
QCon ¡London ¡2012 ¡ 33 ¡
Release With Artifactory: Mechanics
ü : The Artifactory Jenkins Plugin
> Gathers build information > Uploads artifacts in bulk > Uploads build information > Provides bi-directional linking
ü Release Management
> Changes versions in build script > Allows to Choose repository to deploy to > Creates a VCS tag/branch
QCon ¡London ¡2012 ¡ 34 ¡
DEMO ¡TIME! ¡
Release ¡With ¡Release ¡Candidate ¡
OOTB Release Management ü Pros
> Out of the box > Supports the “by the book” release cycle > Supports majority of the tools
ü Cons
> Not flexible > Not extensible > May not suite your case
We Know: We Don’t Know Better
ü YMMV (great deal) ü Write your own release logic ü Pre and post build deploy hooks
QCon ¡London ¡2012 ¡ 37 ¡
Flexible Release
ü Code your release strategy
> Versioning scheme > VCS (tagging, branching, commit comments) > Promotion hook (copy/move, comments, status)
ü Available by REST
QCon ¡London ¡2012 ¡ 38 ¡
Controlling Versioning Scheme
ü Classic versioning scheme:
> Release version
› 2.0.3
> Integration version
› 2.0.4-SNAPSHOT
ü YMMV
> Write your own strategy for versioning > Dynamic Groovy code
QCon ¡London ¡2012 ¡ 39 ¡
Example: Promotion of Snapshots
ü Sometimes the build takes long time… ü But that’s the silly reason
40 ¡ QCon ¡London ¡2012 ¡
Release With Release Candidate
ü Process:
- 1. Produce and build snapshots until satisfied
- 2. Once satisfied, build release candidate
- 3. Stage RC, check and verify
- 4. Once checked, release
QCon ¡London ¡2012 ¡ 41 ¡
Release With Release Candidate
ü Process:
- 1. Produce and build snapshots until satisfied
- 3. Stage RC, check and verify
- 4. Once checked, release
QCon ¡London ¡2012 ¡ 42 ¡
Release With Release Candidate
ü Lots of things can go wrong during one more build ü If we won’t build it, we won’t screw it ü Process:
- 1. Produce and build snapshots until satisfied
- 2. When satisfied, check and verify
- 3. Once checked, release
QCon ¡London ¡2012 ¡ 43 ¡
Example: Promotion of Snapshots
ü Choose existing build to become a release ü Using REST API without build server ü Invoke Promotion plugin
> Convert to next version > Tag, branch, etc. > Promote (copy/move)
QCon ¡London ¡2012 ¡ 44 ¡
CODE ¡TIME! ¡
Plugin ¡What? ¡
ü Groovy goodness ü Executed directly in Artifactory ü Uses Public API
> Search for artifacts > Search for builds > Copy/Move artifacts > Manipulate files
› E.g. change versions in descriptors
QCon ¡London ¡2012 ¡ 46 ¡
Plugin Code
Plugin Code
ü Manipulating Version Control Systems
QCon ¡London ¡2012 ¡ 47 ¡
Plugin Code
ü Manipulating BuildInfo object
QCon ¡London ¡2012 ¡ 48 ¡
Plugin Code
ü Creating and replacing artifacts
QCon ¡London ¡2012 ¡ 49 ¡
QCon ¡London ¡2012 ¡ 50 ¡
Calling REST API With CURL
http://repo-demo:8080/ artifactory/api/plugins/ build/promote/snapshotToRelease/ gradle-multi-example/1? params=snapExp=d14| targetRepository=gradle-release- local
QCon ¡London ¡2012 ¡ 51 ¡
Calling REST API With CURL
http://repo-demo:8080/ artifactory/api/plugins/ build/promote/snapshotToRelease/ gradle-multi-example/1? params=snapExp=d14| targetRepository=gradle-release- local
QCon ¡London ¡2012 ¡ 52 ¡
Calling REST API With CURL
ArRfactory ¡Server ¡
http://repo-demo:8080/ artifactory/api/plugins/ build/promote/snapshotToRelease/ gradle-multi-example/1? params=snapExp=d14| targetRepository=gradle-release- local
QCon ¡London ¡2012 ¡ 53 ¡
Calling REST API With CURL
ArRfactory ¡Server ¡ Plugins ¡API ¡
http://repo-demo:8080/ artifactory/api/plugins/ build/promote/snapshotToRelease/ gradle-multi-example/1? params=snapExp=d14| targetRepository=gradle-release- local
QCon ¡London ¡2012 ¡ 54 ¡
Calling REST API With CURL
ArRfactory ¡Server ¡ Plugins ¡API ¡ Plugin ¡Name ¡
http://repo-demo:8080/ artifactory/api/plugins/ build/promote/snapshotToRelease/ gradle-multi-example/1? params=snapExp=d14| targetRepository=gradle-release- local
QCon ¡London ¡2012 ¡ 55 ¡
Calling REST API With CURL
ArRfactory ¡Server ¡ Plugins ¡API ¡ Plugin ¡Name ¡ Build ¡Name ¡and ¡Number ¡
http://repo-demo:8080/ artifactory/api/plugins/ build/promote/snapshotToRelease/ gradle-multi-example/1? params=snapExp=d14| targetRepository=gradle-release- local
QCon ¡London ¡2012 ¡ 56 ¡
Calling REST API With CURL
ArRfactory ¡Server ¡ Plugins ¡API ¡ Plugin ¡Name ¡ Build ¡Name ¡and ¡Number ¡ Param: ¡Versioning ¡Scheme ¡
http://repo-demo:8080/ artifactory/api/plugins/ build/promote/snapshotToRelease/ gradle-multi-example/1? params=snapExp=d14| targetRepository=gradle-release- local
QCon ¡London ¡2012 ¡ 57 ¡
Calling REST API With CURL
ArRfactory ¡Server ¡ Plugins ¡API ¡ Plugin ¡Name ¡ Build ¡Name ¡and ¡Number ¡ Param: ¡Versioning ¡Scheme ¡ Target ¡repository ¡for ¡release ¡
Recap: Promotion of Snapshots
ü Choose existing build to become a release ü Using REST API without build server ü Invoke Promotion plugin
> Convert to next version > Tag, branch, etc. > Promote (copy/move)
QCon ¡London ¡2012 ¡ 58 ¡
DEMO ¡TIME! ¡
Release ¡by ¡Snapshot ¡PromoRon ¡
4 Commandments of DevOps
ü Automate everything ü Version everything ü Trace everything ü Report/Log/ Feedback everything
QCon ¡London ¡2012 ¡ 60 ¡
Designed ¡by ¡Jessica ¡Allen ¡on ¡Dribbble.com ¡