THERE IS NO SNAPSHOTHvordan vi senket release fra halv dag til halv time
Compile once
Gradle
YOU WILL LEARN
DISCLAIMERIt’s JVM
BACKGROUND
• Monolitt
• 46 modules
• ca 2100 .scala
• Build
• Test
• Integrasjonstest
• 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 2t 30 mins
• til tider 5t eller mer
• samtidige bygg == crash
TENK NYTT
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• Inkrementell og parallell
kompilering • Zinc• Deployscripts i Groovy • Unittest buildscripts• gradle wrapper • Stort community• ++
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 EKSEMPEL
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}
Sjekk for snapshot avhengigheter
Logg inn som PROD-deploy-bruker
Press Play on tape
curl slack.com channel #prod: “🚀 we have liftoff”
Promote to PROD
PROMOTED BUILD
PROMOTED BUILD
👎
Foretrekk Build Pipeline
git tag v0.9.3
Keep build forever (look Ma! No Nexus/Artifactory!)
IN REAL LIFE
Create release version in JIRA
Update minor version in step one
CLEAN, COMPILE, TEST,INTEGRATIONTEST
• avg = 25 mins• spikes på 30+ mins skyldes
samtidige pull request bygg• alle bygg har final
versjonsnummer
• who broke the build?
WILL MY PULL REQUEST COMPILE?
Github flow
The git-flow process is designed largely around the “release”. We don’t really have “releases” because we deploy to
production every day – often several times a day.
COMMIT STATUS APIhttps://github.com/blog/1227-commit-status-api
masterFFS-666
WILL YOU APPROVE MY
PULL REQUEST?
DEPLOYFeature toggleRelease branch
WILL YOU SUM IT UP
• Bygg alt med unikt nummer
• Kompiler én gang
• Gradle(sbt) > Maven
ANSWER YOUR
QUESTIONS
I WILL
Top Related