Frequently deploying to production puts bigger pressure than before on DevOps to make sure the good, qualified application is provisioned with no mistakes. This session will explore some common pitfalls with traditional Continuous-Integration that increase risk, introduce manual input and human error, and generally make DevOps cringe before hitting the “deploy” button.
We will then demonstrate automation techniques that overcome these issues using popular tools, like Maven, Gradle, your CI server, custom scripts and a Binary Repository. Whether you are building software for the cloud or in-house, this presentation will show you how to have completely automated production builds that release applications which are fully traceable, managed and ready to be provisioned with no fear!
5. What’s So Good About *aaS?
*aaS features Continuous Delivery
JavaOne Russia 2012 5
6. Continuous Delivery FTW
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?
JavaOne Russia 2012 6
7. Almost, except the IT
Used to quarterly release cycles
“Secure” pace
Minimizing the entropy caused by
developers with ADD
JavaOne Russia 2012 7
9. 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
JavaOne Russia 2012 9
10. 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
JavaOne Russia 2012 10
11. It’s… Agile!
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?
JavaOne Russia 2012 11
12. Agile Tooling for DevOps Checklist
Versioning
Access control
Traceability
Promotions
Tags and
annotations
Search
JavaOne Russia 2012 12
13. How Do I Know?
JFrog SaaS offering
> Artifactory Online
› Gradle, Grails, SpringSo
urce, Typesafe, Jenkins
, etc.
We build, release
and eat our own dog
food
> Continuously
JavaOne Russia 2012 13
15. Here Comes Binary Repository
E.g. Artifactory
Proxy
Smart storage
> Much more than a passive space
Critical for CI/CD and ALM
JavaOne Russia 2012 15
19. 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
20. The Release Pipeline
Source: Agile ALM, Michael Hüttermann, Manning Publications Co.
JavaOne Russia 2012 20
21. Passing the software to QA
Different access rights
Different physical location
Ability to annotate
JavaOne Russia 2012 21
22. Staging and Preproduction
Replication of Production environment
> Lock versions of dependencies and artifacts
Allow access to set of users
JavaOne Russia 2012 22
23. Going to Production
Convert staging binaries to production
Allow public access
Change settings
Tag
JavaOne Russia 2012 23
24. 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
25. 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
33. Target: Automation
It’s impossible to release frequently with
manual procedures
> While maintaining quality
Use your binaries storage to release
JavaOne Russia 2012 33
35. 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
36. 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
37. Releasing With Artifactory Plugin
Changes versions in build script
Allows choosing a target deploy
repository
Creates a VCS tag/branch
JavaOne Russia 2012 37
39. OOTB Release Management
Pros Cons
> Out of the box > Limited
> Supports the “by extensibility
the book” > May not fit your
release cycle requirements
> Supports
majority of the
tools
JavaOne Russia 2012
40. 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
41. 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
42. 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
43. Target: Automation
It’s impossible to release frequently with
manual procedures
> While maintaining quality
Use your binaries storage to release
JavaOne Russia 2012 43
44. Automation Flexibility
We Know: We Don’t Know Better
YMMV (great deal) Write your own
release logic
Pre and post
build deploy
hooks
JavaOne Russia 2012 44
45. 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
46. 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
47. Example: Promotion of Snapshots
Sometimes
the build
takes long
time…
But that’s the
silly reason
JavaOne Russia 2012 47
48. 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
50. Pluggable Architecture with DSLs
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
JavaOne Russia 2012
51. Plugin Invocation Options
As a response for various events
> Download/Create/Delete
> Login
> Release
Scheduled
On demand
JavaOne Russia 2012 51
52. Plugin Code
Manipulating Version Control Systems
JavaOne Russia 2012 52
56. 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
JavaOne Russia 2012 56
57. Calling REST API With CURL
http://repo-demo:8080/ Artifactory server
artifactory/api/plugins/
build/promote/snapshotToRelease/
gradle-multi-example/1?
params=snapExp=d14|
targetRepository=gradle-release-
local
JavaOne Russia 2012 57
58. Calling REST API With CURL
http://repo-demo:8080/ Artifactory server
artifactory/api/plugins/ Plugins API
build/promote/snapshotToRelease/
gradle-multi-example/1?
params=snapExp=d14|
targetRepository=gradle-release-
local
JavaOne Russia 2012 58
59. Calling REST API With CURL
http://repo-demo:8080/ Artifactory server
artifactory/api/plugins/ Plugins API
build/promote/snapshotToRelease/
Plugin name
gradle-multi-example/1?
params=snapExp=d14|
targetRepository=gradle-release-
local
JavaOne Russia 2012 59
60. Calling REST API With CURL
http://repo-demo:8080/ Artifactory server
artifactory/api/plugins/ Plugins API
build/promote/snapshotToRelease/Plugin name
gradle-multi-example/1? Build name and number
params=snapExp=d14|
targetRepository=gradle-release-
local
JavaOne Russia 2012 60
61. Calling REST API With CURL
http://repo-demo:8080/ Artifactory server
artifactory/api/plugins/ Plugins API
build/promote/snapshotToRelease/ Plugin name
gradle-multi-example/1? Build name and number
params=snapExp=d14| versioning scheme
targetRepository=gradle-release-
local
JavaOne Russia 2012 61
62. Calling REST API With CURL
http://repo-demo:8080/ Artifactory server
artifactory/api/plugins/ Plugins API
build/promote/snapshotToRelease/ Plugin name
gradle-multi-example/1? Build name and number
params=snapExp=d14| versioning scheme
targetRepository=gradle-release-
local Target repository for release
JavaOne Russia 2012 62
63. 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
65. 4 Commandments of DevOps
Automate
everything
Version
everything
Trace everything
Report/Log/Feed
back everything Designed by Jessica Allen on Dribbble.com
JavaOne Russia 2012 65
66. 4 Commandments of DevOps
Automate
everything
Version
everything
Trace everything
Report/Log/Feed
back everything Designed by Jessica Allen on Dribbble.com
JavaOne Russia 2012 66
Editor's Notes
Attention deficit disorderСиндром дефицита внимания
Mention smart artifact/library manager
Freedom of choice for developers, no lockinopensource
Bill Of Materials
Show proxyingP2
Let’s admitit, maybe I shouted, but we are all scared to death
Choose your deployment repositories - independently of VCS, build tool, etc.