build trust in your build-to-deployment flow!

67
Build Trust in Your Build-to-Deployment Flow Baruch Sadogursky, JFrog

Upload: baruch-sadogursky

Post on 19-May-2015

1.427 views

Category:

Technology


1 download

DESCRIPTION

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!

TRANSCRIPT

Page 1: Build Trust in Your Build-to-Deployment Flow!

Build Trust in Your Build-to-Deployment Flow

Baruch Sadogursky, JFrog

Page 2: Build Trust in Your Build-to-Deployment Flow!

Baruch Sadogursky Developer Advocate @JFrog

>Job definition (part of): Hang out with the DevOps guys

@jbaruch

2

About me

JavaOne Russia 2012

Page 3: Build Trust in Your Build-to-Deployment Flow!

The cloud silver bullet The right tool for the job Binaries all the way The magic of release

Agenda

JavaOne Russia 2012 3

Page 4: Build Trust in Your Build-to-Deployment Flow!

EVERYTHING *aaSThe New Silver Bullet

Page 5: Build Trust in Your Build-to-Deployment Flow!

What’s So Good About *aaS?

*aaS features Continuous Delivery

JavaOne Russia 2012 5

Page 6: Build Trust in Your Build-to-Deployment Flow!

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

Page 7: Build Trust in Your Build-to-Deployment Flow!

7

Used to quarterly release cycles “Secure” pace Minimizing the entropy caused by

developers with ADD

Almost, except the IT

JavaOne Russia 2012

Page 8: Build Trust in Your Build-to-Deployment Flow!

8

Herding Cats

Developers>Increasing entropy

+IT (operations)

>Maintaining stability

=DevOps

>Stable change

JavaOne Russia 2012

Page 9: Build Trust in Your Build-to-Deployment Flow!

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

9JavaOne Russia 2012

Page 10: Build Trust in Your Build-to-Deployment Flow!

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

10JavaOne Russia 2012

Page 11: Build Trust in Your Build-to-Deployment Flow!

It’s… Agile!

11JavaOne 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?

Page 12: Build Trust in Your Build-to-Deployment Flow!

Agile Tooling for DevOps Checklist

Versioning Access control Traceability Promotions Tags and

annotations Search

12JavaOne Russia 2012

Page 13: Build Trust in Your Build-to-Deployment Flow!

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

13JavaOne Russia 2012

Page 14: Build Trust in Your Build-to-Deployment Flow!

HERE COMES BINARY REPOSITORYThe Right Tool for the Job

Page 15: Build Trust in Your Build-to-Deployment Flow!

Here Comes Binary Repository

15JavaOne Russia 2012

E.g. Artifactory Proxy Smart storage

>Much more than a passive space Critical for CI/CD and ALM

Page 16: Build Trust in Your Build-to-Deployment Flow!

16

Tooling Chain

JavaOne Russia 2012

Page 17: Build Trust in Your Build-to-Deployment Flow!

17

Artifactory in DevOps Ecosystem

JavaOne Russia 2012

Page 18: Build Trust in Your Build-to-Deployment Flow!

DEMO TIME!Meet Your Binary Repository

Page 19: Build Trust in Your Build-to-Deployment Flow!

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

Page 20: Build Trust in Your Build-to-Deployment Flow!

20

The Release Pipeline

Source: Agile ALM, Michael Hüttermann, Manning Publications Co.

JavaOne Russia 2012

Page 21: Build Trust in Your Build-to-Deployment Flow!

Passing the software to QA

Different access rights Different physical location Ability to annotate

JavaOne Russia 2012 21

Page 22: Build Trust in Your Build-to-Deployment Flow!

Staging and Preproduction

Replication of Production environment>Lock versions of dependencies and

artifacts Allow access to set of users

JavaOne Russia 2012 22

Page 23: Build Trust in Your Build-to-Deployment Flow!

Going to Production

Convert staging binaries to production

Allow public access Change settings Tag

JavaOne Russia 2012 23

Page 24: Build Trust in Your Build-to-Deployment Flow!

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

Page 25: Build Trust in Your Build-to-Deployment Flow!

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

Page 26: Build Trust in Your Build-to-Deployment Flow!

DEMO TIME!Tracing Artifacts

Page 27: Build Trust in Your Build-to-Deployment Flow!

WHAT MY FRIENDS THINK I DODevOps

Page 28: Build Trust in Your Build-to-Deployment Flow!

What Others Think I Do

JavaOne Russia 2012 28

Page 29: Build Trust in Your Build-to-Deployment Flow!

What I Think I Do

JavaOne Russia 2012 29

Page 30: Build Trust in Your Build-to-Deployment Flow!

What I Really Do

JavaOne Russia 2012 30

Page 31: Build Trust in Your Build-to-Deployment Flow!

What I Really Do

JavaOne Russia 2012 31

Page 32: Build Trust in Your Build-to-Deployment Flow!

32

What I should Do

JavaOne Russia 2012

Page 33: Build Trust in Your Build-to-Deployment Flow!

33

Target: Automation

It’s impossible to release frequently with manual procedures>While maintaining quality

Use your binaries storage to release

JavaOne Russia 2012

Page 34: Build Trust in Your Build-to-Deployment Flow!

THE MAGIC OF RELEASEPut your repository to work

Page 35: Build Trust in Your Build-to-Deployment Flow!

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

Page 36: Build Trust in Your Build-to-Deployment Flow!

Releasing with Release Candidates

Process:1. Produce and build snapshots until

satisfied2. Once satisfied, build a release

candidate3. Stage RC, check and verify4. Once verified, release

JavaOne Russia 2012 36

Page 37: Build Trust in Your Build-to-Deployment Flow!

Releasing With Artifactory Plugin

JavaOne Russia 2012 37

Changes versions in build script Allows choosing a target deploy

repository Creates a VCS tag/branch

Page 38: Build Trust in Your Build-to-Deployment Flow!

DEMO TIME!Release With Release Candidates

Page 39: Build Trust in Your Build-to-Deployment Flow!

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

Page 40: Build Trust in Your Build-to-Deployment Flow!

Releasing with Release Candidates

Process:1. Produce and build snapshots until

satisfied2. Once satisfied, build a release

candidate3. Stage RC, check and verify4. Once checked, release

JavaOne Russia 2012 40

Page 41: Build Trust in Your Build-to-Deployment Flow!

Releasing with Release Candidates

Process:1. Produce and build snapshots until

satisfied2. Once satisfied, build release

candidate3. Stage RC, check and verify4. Once checked, release

JavaOne Russia 2012 41

Redundant build

Page 42: Build Trust in Your Build-to-Deployment Flow!

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 verify3. Once checked, release

JavaOne Russia 2012 42

Page 43: Build Trust in Your Build-to-Deployment Flow!

43

Target: Automation

It’s impossible to release frequently with manual procedures>While maintaining quality

Use your binaries storage to release

JavaOne Russia 2012

Page 44: Build Trust in Your Build-to-Deployment Flow!

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

Page 45: Build Trust in Your Build-to-Deployment Flow!

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

Page 46: Build Trust in Your Build-to-Deployment Flow!

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

Page 47: Build Trust in Your Build-to-Deployment Flow!

Example: Promotion of Snapshots

Sometimes the build takes long time…

But that’s the silly reason

47JavaOne Russia 2012

Page 48: Build Trust in Your Build-to-Deployment Flow!

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

Page 49: Build Trust in Your Build-to-Deployment Flow!

CODE TIME!Plugin What?

Page 50: Build Trust in Your Build-to-Deployment Flow!

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

Page 51: Build Trust in Your Build-to-Deployment Flow!

51

As a response for various events>Download/Create/Delete>Login>Release

Scheduled On demand

JavaOne Russia 2012

Plugin Invocation Options

Page 52: Build Trust in Your Build-to-Deployment Flow!

52

Plugin Code

Manipulating Version Control Systems

JavaOne Russia 2012

Page 53: Build Trust in Your Build-to-Deployment Flow!

53

Plugin Code

Manipulating BuildInfo object

JavaOne Russia 2012

Page 54: Build Trust in Your Build-to-Deployment Flow!

54

Plugin Code

Creating and replacing artifactsJavaOne Russia 2012

Page 55: Build Trust in Your Build-to-Deployment Flow!

55

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

JavaOne Russia 2012

Calling REST API With CURL

Page 56: Build Trust in Your Build-to-Deployment Flow!

56

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

JavaOne Russia 2012

Calling REST API With CURL

Page 57: Build Trust in Your Build-to-Deployment Flow!

57

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

JavaOne Russia 2012

Calling REST API With CURL

Artifactory server

Page 58: Build Trust in Your Build-to-Deployment Flow!

58

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

JavaOne Russia 2012

Calling REST API With CURL

Artifactory server

Plugins API

Page 59: Build Trust in Your Build-to-Deployment Flow!

59

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

JavaOne Russia 2012

Calling REST API With CURL

Artifactory server

Plugins API

Plugin name

Page 60: Build Trust in Your Build-to-Deployment Flow!

60

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

JavaOne Russia 2012

Calling REST API With CURL

Artifactory server

Plugins API

Plugin name

Build name and number

Page 61: Build Trust in Your Build-to-Deployment Flow!

61

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

JavaOne Russia 2012

Calling REST API With CURL

Artifactory server

Plugins API

Plugin name

Build name and number

versioning scheme

Page 62: Build Trust in Your Build-to-Deployment Flow!

62

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

JavaOne Russia 2012

Calling REST API With CURL

Artifactory server

Plugins API

Plugin name

Build name and number

versioning scheme

Target repository for release

Page 63: Build Trust in Your Build-to-Deployment Flow!

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

Page 64: Build Trust in Your Build-to-Deployment Flow!

DEMO TIME!Release by Snapshot Promotion

Page 65: Build Trust in Your Build-to-Deployment Flow!

4 Commandments of DevOps

Automate everything

Version everything

Trace everything

Report/Log/Feedback everything

JavaOne Russia 2012 65

Designed by Jessica Allen on Dribbble.com

Page 66: Build Trust in Your Build-to-Deployment Flow!

4 Commandments of DevOps

Automate everything

Version everything

Trace everything

Report/Log/Feedback everything

JavaOne Russia 2012 66

Designed by Jessica Allen on Dribbble.com

Page 67: Build Trust in Your Build-to-Deployment Flow!