Continuous delivery with Gradle
-
Upload
bob-paulin -
Category
Technology
-
view
993 -
download
6
Transcript of Continuous delivery with Gradle
![Page 2: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/2.jpg)
ABOUT MEIndependent ConsultantBusiness EnablementWeb Centric PlatformsAutomation
![Page 3: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/3.jpg)
I LOVE DELIVERING SOFTWARE
I WANT TO DELIVER SOFTWARE ALL THE TIME!
MULTIPLE TIMES A DAY!
![Page 4: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/4.jpg)
WAIT PEOPLE ACTUALLY DO THAT?
![Page 5: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/5.jpg)
SEVERAL MAJOR ECOMMERCE SHOPSETSY.COM DEPLOYS ABOUT 30 TIMES EACH DAY
MY PERSONAL RECORD 5
![Page 6: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/6.jpg)
BENEFITS OF CONTINUOUS DELIVERYShorten the time it takes from conception to customer impactExperiment more frequentlyDo more concurrentlyDelivery becomes a non-event
![Page 7: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/7.jpg)
DELIVERING SOFTWARE CAN BE PAINFUL!Needs to be AssembledNeeds to be DeployedNeeds to be TestedHow can I make sure I don't break existing stuff?What happens if I do break something?What about dependent systems?How do I know what changed?How do I control what goes in and what does not?
![Page 8: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/8.jpg)
ALL THAT'S GOING TO TAKE ME AT LEAST 2WEEKS!
![Page 9: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/9.jpg)
RELEASE MANAGEMENT 101Consistent Build ProcessFunctional/Regression TestingVersioningSource Code ManagementDeployment ProcessRollback
![Page 10: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/10.jpg)
RELEASE MANAGEMENT 501Config SwitchesFeature BranchingModular DeploymentThrottlingAuto ProvisioningAuto-Scaling
![Page 11: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/11.jpg)
TOOLS TO THE RESCUE!
![Page 12: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/12.jpg)
BUILD TOOLS
![Page 13: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/13.jpg)
Dependency ManagementPackagingPlugin ArchitectureLifecycle ManagementVersioning
![Page 14: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/14.jpg)
A RECIPE FOR CONTINUOUS DELIVERYGradleArtifactoryGit
![Page 15: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/15.jpg)
GRADLEBuild ToolGroovyCombines some of the best features of Ant and MavenConventionsPlugins
![Page 16: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/16.jpg)
ARTIFACTORYBinary RepositoryJEE Web AppSupports Maven and IvyOpen Source and Pro Licensed
![Page 17: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/17.jpg)
GITSource Control ManagementDistributedTagging/Branch/Merge
![Page 18: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/18.jpg)
HOW DOES ALL THIS STUFF WORKTOGETHER?
![Page 19: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/19.jpg)
STEPS
![Page 20: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/20.jpg)
SYSTEM INTERACTION
![Page 21: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/21.jpg)
A BRIEF ASIDE ON SEMANTIC VERSIONING
![Page 22: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/22.jpg)
LETS LOOK AT SOME CODE!
![Page 23: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/23.jpg)
GRADLE PLUGINSWar PluginCargo PluginMaven Plugin
![Page 24: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/24.jpg)
GRADLE CONFIGURATIONSCONFIG + CODE!
![Page 25: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/25.jpg)
cargo { containerId = 'tomcat7x' port = Integer.parseInt(getProperty(project.env + ".deployPort"))
deployable { context = artifactId file = project.file(artifactDownloadPath) } remote { hostname = getProperty(project.env + ".deployHostname") username = getProperty(project.env + ".deployUserName") password = getProperty(project.env + ".deployPassword") } }
![Page 26: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/26.jpg)
DON'T EMBED ENVIRONMENT DATA INTO THEBUILD SCRIPT!
CREATE A USER PROPERTIES FILE INSTEAD.
![Page 27: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/27.jpg)
DEPENDENCY MANAGEMENTFOR YOUR APPLICATION AND FOR YOUR BUILD
![Page 28: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/28.jpg)
buildscript { repositories { maven { url "https://oss.sonatype.org/content/groups/public"} mavenCentral() }
dependencies { classpath "javax.servlet:servlet-api:2.5", "org.gradle.api.plugins:gradle-cargo-plugin:0.6.1", "org.ajoberstar:gradle-git:0.6.3" }}
![Page 29: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/29.jpg)
dependencies { def cargoVersion = '1.3.3' def springVersion = '3.2.3.RELEASE' def wro4JVersion = '1.6.3' def aopAllainceVersion = '1.0' cargo "org.codehaus.cargo:cargo-core-uberjar:$cargoVersion", "org.codehaus.cargo:cargo-ant: compile "org.springframework:spring-aop:$springVersion", "org.springframework:spring-beans: "org.springframework:spring-context:$springVersion","org.springframework:spring-context-support: "org.springframework:spring-expression:$springVersion", "org.springframework:spring-tx: "org.springframework:spring-web:$springVersion", "org.springframework:spring-webmvc: "javax.servlet:jstl:1.2","org.slf4j:slf4j-api:1.5.6", "org.slf4j:jcl-over-slf4j:1.5.6" "org.codehaus.jackson:jackson-mapper-asl:1.9.3","aopalliance:aopalliance:$aopAllainceVersion compile("org.springframework.data:spring-data-mongodb:1.0.4.RELEASE"){ exclude module: "slf4j-api" } compile("org.springframework:spring-core:$springVersion"){ exclude module: 'commons-logging' } compile ("ro.isdc.wro4j:wro4j-core:$wro4JVersion") { exclude module: "slf4j-api" } compile("ro.isdc.wro4j:wro4j-extensions:$wro4JVersion") { exclude module: "slf4j-api" exclude module: "slf4j-log4j12" } providedCompile "javax.el:el-api:1.0", "javax.servlet.jsp:jsp-api:2.0", "javax.servlet:servlet-api:2.5" testCompile "junit:junit:3.8.1", "org.springframework:spring-test:$springVersion
}
![Page 30: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/30.jpg)
GRADLE TASKS
![Page 31: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/31.jpg)
task updateUploadedPom(dependsOn: 'getBranchName') << { def pomVersion = project.version if(!project.getGradle().getTaskGraph().hasTask(":release")) pomVersion += ".$branchName" uploadArchives.repositories.mavenDeployer.pom.version = pomVersion}
![Page 32: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/32.jpg)
task tag(type: GitTag) { tagName = version message = "Release of ${version}"}
task pushToRemote(type: GitPush){ pushAll = true}
![Page 33: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/33.jpg)
task qaRelease { dependsOn test, war, getBranchName, updateUploadedPom, uploadArchives, updateVersionNumber, addVersion}
![Page 34: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/34.jpg)
GRADLE TASK DEPENDENCIES
![Page 35: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/35.jpg)
//Task Dependencieswar.mustRunAfter testtag.mustRunAfter warupdateUploadedPom.mustRunAfter taguploadArchives.mustRunAfter updateUploadedPomupdateVersionNumber.mustRunAfter uploadArchivesaddVersionUpdate.mustRunAfter updateVersionNumbercommitVersionUpdate.mustRunAfter addVersionUpdatepushToRemote.mustRunAfter commitVersionUpdate
![Page 36: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/36.jpg)
DEMO TIME!A SIMPLE BOOK REVIEW WEBSITE
![Page 37: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/37.jpg)
ADDING BOOK RATINGS SCORE TO THE SITE
![Page 38: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/38.jpg)
CREATING A FEATURE BRANCH
![Page 39: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/39.jpg)
WRITE THE CODE... WE ALREADY KNOW HOWTO DO THIS!
![Page 40: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/40.jpg)
BUILD PROCESSWhen you say you're code is done the fun is just beginning...
![Page 41: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/41.jpg)
TESTING PROCESSAre you sure you're done?
![Page 42: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/42.jpg)
RELEASE PROCESSYup we're done!
![Page 43: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/43.jpg)
DEPLOYMENT PROCESSOh yeah now we're done
![Page 44: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/44.jpg)
AN ASIDEWhy is deploy separate from release?
![Page 45: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/45.jpg)
DEPLOYMENT PROCESS: TAKE 2Oh ****! What have we done?!?!
![Page 46: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/46.jpg)
KNOW YOUR ROLLBACK STRATEGY BEFOREEVERY DEPLOYMENT
![Page 47: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/47.jpg)
ENTERPRISE ARCHITECTURE
![Page 48: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/48.jpg)
SOME PARTING THOUGHTS ON GRADLE ANDCONTINOUS DELIVERY
![Page 49: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/49.jpg)
REFERENCESCODE AND PRESENTATION
GRADLE
GRADLE RELEASE PLUGIN
GIT
ARTIFACTORY
CARGO
SEMANTIC VERSIONING
ETSY'S MIK E BRITTAIN "CONTINUOUS DELIVERY: THE DIRTY DETAILS"
![Page 50: Continuous delivery with Gradle](https://reader034.fdocuments.in/reader034/viewer/2022042700/55649fd7d8b42ab8278b5470/html5/thumbnails/50.jpg)
BOB PAULIN / / BOB PAULIN @BOBPAULIN [email protected]