Build Trust in Your Build-to-Deployment Flow! Baruch - - PowerPoint PPT Presentation

build trust in your build to deployment flow
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Build ¡Trust ¡in ¡Your ¡ ¡Build-­‑to-­‑Deployment ¡Flow! ¡

Baruch ¡Sadogursky, ¡JFrog ¡ ¡

slide-2
SLIDE 2

ü Baruch Sadogursky ü Developer Advocate @JFrog

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

ü @jbaruch

2 ¡

About me

QCon ¡London ¡2012 ¡

slide-3
SLIDE 3

ü The cloud silver bullet ü The right tool for the job ü Binaries all the way ü The black magic

  • f releasing

Agenda

QCon ¡London ¡2012 ¡ 3 ¡

slide-4
SLIDE 4

EVERYTHING ¡*aaS ¡

The ¡New ¡Silver ¡Bullet ¡

slide-5
SLIDE 5

Why We Need *aaS?

ü *aaS features Continuous Delivery

QCon ¡London ¡2012 ¡ 5 ¡

slide-6
SLIDE 6

ü 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 ¡

slide-7
SLIDE 7

Almost, except DevOps

ü Very frequent releases ü More than one version in production ü Complicated access levels

7 ¡ QCon ¡London ¡2012 ¡

slide-8
SLIDE 8

Almost, except DevOps

ü Very frequent releases ü More than one version in production ü Complicated access levels

8 ¡ QCon ¡London ¡2012 ¡

slide-9
SLIDE 9

Almost, except DevOps

ü Root cause analysis

> Trace from binaries to sources > Reproduction abilities

ü Promotions

> Status changes

9 ¡ QCon ¡London ¡2012 ¡

slide-10
SLIDE 10

Almost, except DevOps

ü Root cause analysis

> Trace from binaries to sources > Reproduction abilities

ü Promotions

> Status changes

10 ¡ QCon ¡London ¡2012 ¡

slide-11
SLIDE 11

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 ¡

slide-12
SLIDE 12

Agile Tooling for DevOps Checklist

ü Versioning ü Access control ü Traceability ü Promotions ü Tags and annotations ü Search

12 ¡ QCon ¡London ¡2012 ¡

slide-13
SLIDE 13

How Do I Know?

ü JFrog SaaS offering

> Artifactory Online

ü We build, release and eat our own dog food

> Continuously

13 ¡ QCon ¡London ¡2012 ¡

slide-14
SLIDE 14

HERE ¡COMES ¡BINARY ¡REPOSITORY ¡

The ¡Right ¡Tool ¡for ¡the ¡Job ¡

slide-15
SLIDE 15

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 ¡

slide-16
SLIDE 16

Tooling Chain

QCon ¡London ¡2012 ¡ 16 ¡

slide-17
SLIDE 17

Artifactory in DevOps Ecosystem

17 ¡ QCon ¡London ¡2012 ¡

slide-18
SLIDE 18

DEMO ¡TIME! ¡

Meet ¡ArRfactory ¡

slide-19
SLIDE 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

QCon ¡London ¡2012 ¡ 19 ¡

slide-20
SLIDE 20

The Release Pipeline

Source: ¡Agile ¡ALM, ¡Michael ¡Hü4ermann, ¡Manning ¡Publica9ons ¡Co. ¡ ¡

20 ¡ QCon ¡London ¡2012 ¡

slide-21
SLIDE 21

Passing the software to QA

ü Different access rights ü Different physical location ü Ability to annotate

QCon ¡London ¡2012 ¡ 21 ¡

slide-22
SLIDE 22

Staging and Preproduction

ü Replication of Production environment

> Lock versions of dependencies and artifacts

ü Allow access to set of users

QCon ¡London ¡2012 ¡ 22 ¡

slide-23
SLIDE 23

Going to Production

ü Convert staging binaries to production ü Allow public access ü Change settings ü Tag

QCon ¡London ¡2012 ¡ 23 ¡

slide-24
SLIDE 24

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 ¡

slide-25
SLIDE 25

WHAT ¡MY ¡FRIENDS ¡THINK ¡I ¡DO ¡

DevOps ¡

slide-26
SLIDE 26

What Others Think I Do

QCon ¡London ¡2012 ¡ 26 ¡

slide-27
SLIDE 27

What I Think I Do

QCon ¡London ¡2012 ¡ 27 ¡

slide-28
SLIDE 28

What I Really Do

QCon ¡London ¡2012 ¡ 28 ¡

slide-29
SLIDE 29

What I should Do

QCon ¡London ¡2012 ¡ 29 ¡

slide-30
SLIDE 30

Target: Automation

ü It’s impossible to release frequently with manual procedures

> While maintaining quality

ü Use your binaries storage to release

QCon ¡London ¡2012 ¡ 30 ¡

slide-31
SLIDE 31

THE ¡MAGIC ¡OF ¡RELEASE ¡

Put ¡your ¡repository ¡to ¡work ¡

slide-32
SLIDE 32

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 ¡

slide-33
SLIDE 33

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 ¡

slide-34
SLIDE 34

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 ¡

slide-35
SLIDE 35

DEMO ¡TIME! ¡

Release ¡With ¡Release ¡Candidate ¡

slide-36
SLIDE 36

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

slide-37
SLIDE 37

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 ¡

slide-38
SLIDE 38

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 ¡

slide-39
SLIDE 39

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 ¡

slide-40
SLIDE 40

Example: Promotion of Snapshots

ü Sometimes the build takes long time… ü But that’s the silly reason

40 ¡ QCon ¡London ¡2012 ¡

slide-41
SLIDE 41

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 ¡

slide-42
SLIDE 42

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 ¡

slide-43
SLIDE 43

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 ¡

slide-44
SLIDE 44

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 ¡

slide-45
SLIDE 45

CODE ¡TIME! ¡

Plugin ¡What? ¡

slide-46
SLIDE 46

ü 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

slide-47
SLIDE 47

Plugin Code

ü Manipulating Version Control Systems

QCon ¡London ¡2012 ¡ 47 ¡

slide-48
SLIDE 48

Plugin Code

ü Manipulating BuildInfo object

QCon ¡London ¡2012 ¡ 48 ¡

slide-49
SLIDE 49

Plugin Code

ü Creating and replacing artifacts

QCon ¡London ¡2012 ¡ 49 ¡

slide-50
SLIDE 50

QCon ¡London ¡2012 ¡ 50 ¡

Calling REST API With CURL

slide-51
SLIDE 51

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

slide-52
SLIDE 52

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 ¡

slide-53
SLIDE 53

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 ¡

slide-54
SLIDE 54

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 ¡

slide-55
SLIDE 55

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 ¡

slide-56
SLIDE 56

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 ¡

slide-57
SLIDE 57

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 ¡

slide-58
SLIDE 58

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 ¡

slide-59
SLIDE 59

DEMO ¡TIME! ¡

Release ¡by ¡Snapshot ¡PromoRon ¡

slide-60
SLIDE 60

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 ¡

slide-61
SLIDE 61