Upload
ole-christian-langfjaeran
View
174
Download
2
Tags:
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
THERE IS NO SNAPSHOTHow we changed a full release from half a day to half an hour
Compile once
Gradle
IN THIS EPISODE
DISCLAIMERIt’s mostly JVM, but the essence is transferable to other
languages
BACKGROUND
• Monolith
• 46 modules
• about 2100 .scala
• Build
• Test
• Integrationtest
• Release
• Deploy
• Maven
COMPILE, COMPILE, COMPILE
Compile + test
Integration-test mvn release
COMPILE, COMPILE, COMPILE
Compile + test
Integration-test mvn release
25-60 mins 50-120 mins 60-120 mins
SUM• min 2h 30 mins
• at times 5 hours or more
• parallel builds == crash
THINK NEW
HOW?
COMPILE, COMPILE, COMPILE
Compile + test
Integration-test mvn release
COMPILE, COMPILE, COMPILE
Compile + test Snapshots
COMPILE, COMPILE, COMPILE
Compile + test1.10.69
major.minor.buildnumber
OTHERS
????
DOOR #1
MAVEN
DOOR #2
SBT
DOOR #3
GRADLE
PROS• Incremental and parallel
compiling• Zinc• Deployscripts in Groovy• Unittest buildscripts• ++
PLUGINS
Promoted Build
Clone Workspace Copy Artifact
Parameterized Trigger Gradle
PLUGINS (NICE)
Cloudbees Folders Build Pipeline
Git Pull Request Builder
Disk UsageJob Config History
Jenkins slaves
PSEUDO EXAMPLE
Default parameter VERSION=0.9
echo version=${VERSION}.${BUILD_NUMBER} >> gradle.properties
gradle.properties: version=0.9.3
gradle clean test assemble --parallel
archive artifact: embedded-jetty-app.jar
archive workspace
Trigger Send med JOB_NAME, BUILD_NUMBER, Git commit
Clone workspace
gradle integrationtest -x compileScala (++)
git pull ${init_job_git_commit}
Check for snapshot dependencies
Log in as PROD-deployer
Press Play on tape
curl slack.com channel #prod: “🚀 we have liftoff”
Promote to PROD
PROMOTED BUILD
PROMOTED BUILD
👎
Prefer Build Pipeline
Hard to read
git tag v0.9.3
Keep build forever (look Ma! No Nexus/Artifactory!)
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?
?