47
THERE IS NO SNAPSHOT How we changed a full release from half a day to half an hour

There is no snapshot

Embed Size (px)

DESCRIPTION

How we changed full release and deploy from half a day to half an hour using Gradle and Jenkins.

Citation preview

Page 1: There is no snapshot

THERE IS NO SNAPSHOTHow we changed a full release from half a day to half an hour

Page 2: There is no snapshot

Compile once

Gradle

IN THIS EPISODE

Page 3: There is no snapshot

DISCLAIMERIt’s mostly JVM, but the essence is transferable to other

languages

Page 4: There is no snapshot

BACKGROUND

• Monolith

• 46 modules

• about 2100 .scala

Page 5: There is no snapshot

• Build

• Test

• Integrationtest

• Release

• Deploy

• Maven

Page 6: There is no snapshot

COMPILE, COMPILE, COMPILE

Compile + test

Integration-test mvn release

Page 7: There is no snapshot

COMPILE, COMPILE, COMPILE

Compile + test

Integration-test mvn release

25-60 mins 50-120 mins 60-120 mins

Page 8: There is no snapshot

SUM• min 2h 30 mins

• at times 5 hours or more

• parallel builds == crash

Page 9: There is no snapshot

THINK NEW

Page 10: There is no snapshot

HOW?

Page 11: There is no snapshot

COMPILE, COMPILE, COMPILE

Compile + test

Integration-test mvn release

Page 12: There is no snapshot

COMPILE, COMPILE, COMPILE

Compile + test Snapshots

Page 13: There is no snapshot

COMPILE, COMPILE, COMPILE

Compile + test1.10.69

major.minor.buildnumber

Page 14: There is no snapshot

OTHERS

????

Page 15: There is no snapshot

DOOR #1

Page 16: There is no snapshot

MAVEN

Page 17: There is no snapshot

DOOR #2

Page 18: There is no snapshot

SBT

Page 19: There is no snapshot
Page 20: There is no snapshot

DOOR #3

Page 21: There is no snapshot
Page 22: There is no snapshot

GRADLE

Page 23: There is no snapshot

PROS• Incremental and parallel

compiling• Zinc• Deployscripts in Groovy• Unittest buildscripts• ++

Page 24: There is no snapshot

PLUGINS

Promoted Build

Clone Workspace Copy Artifact

Parameterized Trigger Gradle

Page 25: There is no snapshot

PLUGINS (NICE)

Cloudbees Folders Build Pipeline

Git Pull Request Builder

Disk UsageJob Config History

Jenkins slaves

Page 26: There is no snapshot

PSEUDO EXAMPLE

Page 27: There is no snapshot

Default parameter VERSION=0.9

Page 28: There is no snapshot

echo version=${VERSION}.${BUILD_NUMBER} >> gradle.properties

Page 29: There is no snapshot

gradle.properties: version=0.9.3

Page 30: There is no snapshot

gradle clean test assemble --parallel

Page 31: There is no snapshot

archive artifact: embedded-jetty-app.jar

Page 32: There is no snapshot

archive workspace

Page 33: There is no snapshot

Trigger Send med JOB_NAME, BUILD_NUMBER, Git commit

Page 34: There is no snapshot

Clone workspace

Page 35: There is no snapshot

gradle integrationtest -x compileScala (++)

Page 36: There is no snapshot

git pull ${init_job_git_commit}

Page 37: There is no snapshot

Check for snapshot dependencies

Page 38: There is no snapshot

Log in as PROD-deployer

Page 39: There is no snapshot

Press Play on tape

Page 40: There is no snapshot

curl slack.com channel #prod: “🚀 we have liftoff”

Page 41: There is no snapshot

Promote to PROD

Page 42: There is no snapshot

PROMOTED BUILD

Page 43: There is no snapshot

PROMOTED BUILD

👎

Prefer Build Pipeline

Hard to read

Page 44: There is no snapshot

git tag v0.9.3

Page 45: There is no snapshot

Keep build forever (look Ma! No Nexus/Artifactory!)

Page 46: There is no snapshot

CLEAN, COMPILE, TEST,INTEGRATIONTEST

• avg = 25 mins• spikes at 30+ mins when

pull requests starts to buildat the same time

• All builds have final release version

• who broke the build?

Page 47: There is no snapshot

?