Build Trust in Your
Build-to-Deployment Flow
Baruch Sadogursky, JFrog
Slide 2
Slide 2 text
Baruch Sadogursky
Developer Advocate @JFrog
> Job definition (part of):
Hang out with the DevOps guys
@jbaruch
2
About me
JavaOne Russia 2012
Slide 3
Slide 3 text
The cloud silver bullet
The right tool for the job
Binaries all the way
The magic of release
Agenda
JavaOne Russia 2012 3
Slide 4
Slide 4 text
EVERYTHING *aaS
The New Silver Bullet
Slide 5
Slide 5 text
What’s So Good About *aaS?
*aaS features Continuous Delivery
JavaOne Russia 2012 5
Slide 6
Slide 6 text
User advantages
> Latest version/features
> No upgrades/maintenance
Developer advantages
> Agile
> Rapid feedback
> Users are the best beta-testers
> No long-term support
Everybody wins?
6
Continuous Delivery FTW
JavaOne Russia 2012
Slide 7
Slide 7 text
Used to quarterly release cycles
“Secure” pace
Minimizing the entropy caused by
developers with ADD
7
Almost, except the IT
JavaOne Russia 2012
Continuous Delivery Challenge
Very frequent releases
More than one version in production
Complicated access levels
Root cause analysis
> Tracing from binaries to source
Version tracking
Not everyone is ready for CD
9
JavaOne Russia 2012
Slide 10
Slide 10 text
Continuous Delivery Challenge
Very frequent releases
More than one version in production
Complicated access levels
Root cause analysis
> Tracing from binaries to source
Version tracking
Not everyone is ready for CD
10
JavaOne Russia 2012
Slide 11
Slide 11 text
It’s… Agile!
11
JavaOne Russia 2012
Agile principles applied for DevOps
We have good tooling for Agile
development
> Version control
> Unit testing and code coverage
> CI servers
> Hot swap tools
What’s up with tooling for agile DevOps?
Slide 12
Slide 12 text
Agile Tooling for DevOps Checklist
Versioning
Access control
Traceability
Promotions
Tags and
annotations
Search
12
JavaOne Russia 2012
Slide 13
Slide 13 text
How Do I Know?
JFrog SaaS offering
> Artifactory Online
› Gradle, Grails,
SpringSource, Typesafe,
Jenkins, etc.
We build, release
and eat our own dog
food
> Continuously
13
JavaOne Russia 2012
Slide 14
Slide 14 text
HERE COMES BINARY REPOSITORY
The Right Tool for the Job
Slide 15
Slide 15 text
Here Comes Binary Repository
15
JavaOne Russia 2012
E.g. Artifactory
Proxy
Smart storage
> Much more than a passive space
Critical for CI/CD and ALM
Slide 16
Slide 16 text
Tooling Chain
JavaOne Russia 2012 16
Slide 17
Slide 17 text
Artifactory in DevOps Ecosystem
17
JavaOne Russia 2012
Slide 18
Slide 18 text
DEMO TIME!
Meet Your Binary Repository
Slide 19
Slide 19 text
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
JavaOne Russia 2012 19
Slide 20
Slide 20 text
The Release Pipeline
Source: Agile ALM, Michael Hüttermann, Manning Publications Co.
20
JavaOne Russia 2012
Slide 21
Slide 21 text
Passing the software to QA
Different access rights
Different physical location
Ability to annotate
JavaOne Russia 2012 21
Slide 22
Slide 22 text
Staging and Preproduction
Replication of Production environment
> Lock versions of dependencies and artifacts
Allow access to set of users
JavaOne Russia 2012 22
Slide 23
Slide 23 text
Going to Production
Convert staging binaries to production
Allow public access
Change settings
Tag
JavaOne Russia 2012 23
Slide 24
Slide 24 text
Traceability
Binaries should be traceable at every
stage
> Sources
> Dependencies
> Environment details
> Tags
Where’s the information?
> Version control system
> Build server
JavaOne Russia 2012 24
Slide 25
Slide 25 text
Traceability with Artifactory Plugin
Adding Metadata about the build
> Gathers build information
> Uploads artifacts in a bulk
> Uploads build information
> Maintains bi-directional links
JavaOne Russia 2012 25
Slide 26
Slide 26 text
DEMO TIME!
Tracing Artifacts
Slide 27
Slide 27 text
WHAT MY FRIENDS THINK I DO
DevOps
Slide 28
Slide 28 text
What Others Think I Do
JavaOne Russia 2012 28
Slide 29
Slide 29 text
What I Think I Do
JavaOne Russia 2012 29
Slide 30
Slide 30 text
What I Really Do
JavaOne Russia 2012 30
Slide 31
Slide 31 text
What I Really Do
JavaOne Russia 2012 31
Slide 32
Slide 32 text
What I should Do
JavaOne Russia 2012 32
Slide 33
Slide 33 text
Target: Automation
It’s impossible to release frequently with
manual procedures
> While maintaining quality
Use your binaries storage to release
JavaOne Russia 2012 33
Slide 34
Slide 34 text
THE MAGIC OF RELEASE
Put your repository to work
Slide 35
Slide 35 text
Release Candidates
Your next build is a 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
JavaOne Russia 2012 35
Slide 36
Slide 36 text
Releasing with Release Candidates
Process:
1. Produce and build snapshots until satisfied
2. Once satisfied, build a release candidate
3. Stage RC, check and verify
4. Once verified, release
JavaOne Russia 2012 36
Slide 37
Slide 37 text
Releasing With Artifactory Plugin
JavaOne Russia 2012 37
Changes versions in build script
Allows choosing a target deploy
repository
Creates a VCS tag/branch
Slide 38
Slide 38 text
DEMO TIME!
Release With Release Candidates
Slide 39
Slide 39 text
OOTB Release Management
Pros
> Out of the box
> Supports the “by
the book”
release cycle
> Supports
majority of the
tools
Cons
> Limited
extensibility
> May not fit your
requirements
JavaOne Russia 2012
Slide 40
Slide 40 text
Releasing with Release Candidates
Process:
1. Produce and build snapshots until satisfied
2. Once satisfied, build a release candidate
3. Stage RC, check and verify
4. Once checked, release
JavaOne Russia 2012 40
Slide 41
Slide 41 text
Releasing with Release Candidates
Process:
1. Produce and build snapshots until satisfied
3. Stage RC, check and verify
4. Once checked, release
JavaOne Russia 2012 41
Slide 42
Slide 42 text
Releasing with Release Candidates
Lots of things can go wrong during one
more build
If we won’t build it, we won’t screw it
Revised Process:
1. Produce and build snapshots until satisfied
2. When satisfied, check and verify
3. Once checked, release
JavaOne Russia 2012 42
Slide 43
Slide 43 text
Target: Automation
It’s impossible to release frequently with
manual procedures
> While maintaining quality
Use your binaries storage to release
JavaOne Russia 2012 43
Slide 44
Slide 44 text
Automation Flexibility
YMMV (great deal) Write your own
release logic
Pre and post
build deploy
hooks
JavaOne Russia 2012 44
We Know: We Don’t Know Better
Slide 45
Slide 45 text
Flexible Release
Code your release strategy
> Versioning scheme
> VCS (tagging, branching, commit comments)
> Promotion hook (copy/move, comments,
status)
Available by REST
JavaOne Russia 2012 45
Slide 46
Slide 46 text
Controlling Versioning Scheme
Classic versioning scheme:
> Release version
› 2.0.3
> Integration version
› 2.0.4-SNAPSHOT
YMMV
> Write your own strategy for versioning
JavaOne Russia 2012 46
Slide 47
Slide 47 text
Example: Promotion of Snapshots
Sometimes
the build
takes long
time…
But that’s the
silly reason
47
JavaOne Russia 2012
Slide 48
Slide 48 text
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)
JavaOne Russia 2012 48
Slide 49
Slide 49 text
CODE TIME!
Plugin What?
Slide 50
Slide 50 text
Artifactory is open for user plugins
Simple Groovy DSL
Your code runs inside the server
Uses Public API (PAPI)
> Search for artifacts
> Search for builds
> Copy/move artifacts
> Manipulate files
› E.g. change versions in descriptors
Pluggable Architecture with DSLs
JavaOne Russia 2012
Slide 51
Slide 51 text
As a response for various events
> Download/Create/Delete
> Login
> Release
Scheduled
On demand
JavaOne Russia 2012 51
Plugin Invocation Options
Slide 52
Slide 52 text
Plugin Code
Manipulating Version Control Systems
JavaOne Russia 2012 52
Slide 53
Slide 53 text
Plugin Code
Manipulating BuildInfo object
JavaOne Russia 2012 53
Slide 54
Slide 54 text
Plugin Code
Creating and replacing artifacts
JavaOne Russia 2012 54
Slide 55
Slide 55 text
JavaOne Russia 2012 55
Calling REST API With CURL
Slide 56
Slide 56 text
http://repo-demo:8080/
artifactory/api/plugins/
build/promote/snapshotToRelease/
gradle-multi-example/1?
params=snapExp=d14|
targetRepository=gradle-release-
local
JavaOne Russia 2012 56
Calling REST API With CURL
Slide 57
Slide 57 text
http://repo-demo:8080/
artifactory/api/plugins/
build/promote/snapshotToRelease/
gradle-multi-example/1?
params=snapExp=d14|
targetRepository=gradle-release-
local
JavaOne Russia 2012 57
Calling REST API With CURL
Artifactory server
Slide 58
Slide 58 text
http://repo-demo:8080/
artifactory/api/plugins/
build/promote/snapshotToRelease/
gradle-multi-example/1?
params=snapExp=d14|
targetRepository=gradle-release-
local
JavaOne Russia 2012 58
Calling REST API With CURL
Artifactory server
Plugins API
Slide 59
Slide 59 text
http://repo-demo:8080/
artifactory/api/plugins/
build/promote/snapshotToRelease/
gradle-multi-example/1?
params=snapExp=d14|
targetRepository=gradle-release-
local
JavaOne Russia 2012 59
Calling REST API With CURL
Artifactory server
Plugins API
Plugin name
Slide 60
Slide 60 text
http://repo-demo:8080/
artifactory/api/plugins/
build/promote/snapshotToRelease/
gradle-multi-example/1?
params=snapExp=d14|
targetRepository=gradle-release-
local
JavaOne Russia 2012 60
Calling REST API With CURL
Artifactory server
Plugins API
Plugin name
Build name and number
Slide 61
Slide 61 text
http://repo-demo:8080/
artifactory/api/plugins/
build/promote/snapshotToRelease/
gradle-multi-example/1?
params=snapExp=d14|
targetRepository=gradle-release-
local
JavaOne Russia 2012 61
Calling REST API With CURL
Artifactory server
Plugins API
Plugin name
Build name and number
versioning scheme
Slide 62
Slide 62 text
http://repo-demo:8080/
artifactory/api/plugins/
build/promote/snapshotToRelease/
gradle-multi-example/1?
params=snapExp=d14|
targetRepository=gradle-release-
local
JavaOne Russia 2012 62
Calling REST API With CURL
Artifactory server
Plugins API
Plugin name
Build name and number
versioning scheme
Target repository for release
Slide 63
Slide 63 text
Recap: Promotion of Snapshots
Choose existing build to become a
release
Using the REST API without building
Invoking the promotion plugin
> Convert to next version
> Tag, branch, etc.
> Promote (copy/move)
JavaOne Russia 2012 63
Slide 64
Slide 64 text
DEMO TIME!
Release by Snapshot Promotion
Slide 65
Slide 65 text
4 Commandments of DevOps
Automate
everything
Version
everything
Trace everything
Report/Log/Feed
back everything
JavaOne Russia 2012 65
Designed by Jessica Allen on Dribbble.com
Slide 66
Slide 66 text
4 Commandments of DevOps
Automate
everything
Version
everything
Trace everything
Report/Log/Feed
back everything
JavaOne Russia 2012 66
Designed by Jessica Allen on Dribbble.com