Release It!
-
Upload
goldin-evgeny -
Category
Technology
-
view
2.856 -
download
0
description
Transcript of Release It!
Release It!
Using Gradle, TeamCity and Artifactory for making releases the new way
Evgeny Goldin (@evgeny_goldin)
November 14, 2012Wednesday, November 14, 12
Evgeny Goldin
Tel-‐Aviv => Munich => Berlin
Java / Maven => Groovy / Gradle
SCM at Trademob
evgeny-‐goldin.com/wiki
github.com/evgeny-‐goldin
GroovyMag, Gr8Conf
Wednesday, November 14, 12
In this session ..
Releasing a library using Gradle Maven plugin
Releasing a library using Gradle Release plugin
Releasing a library using Artifactory Gradle plugin
Releasing a library using Artifactory TeamCity plugin
Releasing a library using Artifactory user plugins
Wednesday, November 14, 12
In this session ..
Releasing a library using Gradle Maven plugin
Releasing a library using Gradle Release plugin
Releasing a library using Artifactory Gradle plugin
Releasing a library using Artifactory TeamCity plugin
Releasing a library using Artifactory user plugins
Metadata, Traceability, Staging, Promotion
Wednesday, November 14, 12
Meet the players!
Gradle -‐ general purpose build tool
TeamCity -‐ general purpose build server (Web UI)
Artifactory -‐ general purpose binaries repository (Web UI)
Have Java roots but technology agnostic
Wednesday, November 14, 12
Meet the players!
Gradle -‐ Java, Groovy, Scala, C++, OSGi, Maven
TeamCity -‐ Java, .NET, Objective-‐C, Python, Ruby
Artifactory -‐ Java, .NET, P2, Linux, Build tools and servers
Have Java roots but technology agnostic
Wednesday, November 14, 12
Wednesday, November 14, 12
Build environment = build tool + build server + binaries repo
Wednesday, November 14, 12
apply plugin: 'about'
Wednesday, November 14, 12
v0.1 -‐ Local Maven repository
gradle install
Wednesday, November 14, 12
v 0.2 -‐ Manual Artifacts Upload
Wednesday, November 14, 12
v0.3 -‐ Maven repo deploy
gradle uploadArchives
Wednesday, November 14, 12
v0.3 -‐ Maven repo deploy
Were you committed?
Up-‐to-‐date?
Had any unversioned files?
Used SNAPSHOT dependencies?
Did you forget to tag / branch?
Wednesday, November 14, 12
v0.4 -‐ Gradle release plugin
gradle release
Wednesday, November 14, 12
v0.4 -‐ Gradle release plugin
Checks if Update / Commit / Push needed
Verifies no SNAPSHOT dependencies are used
Verifies no unversioned files are found
Updates version number:
0.4 => 0.5
0.4-‐SNAPSHOT => 0.4 => 0.5-‐SNAPSHOT
Wednesday, November 14, 12
v0.4 -‐ Gradle release plugin
Checks if Update / Commit / Push needed
Verifies no SNAPSHOT dependencies are used
Verifies no unversioned files are found
Updates version number:
0.4 => 0.5
0.4-‐SNAPSHOT => 0.4 => 0.5-‐SNAPSHOT
Adds SCM tag
Wednesday, November 14, 12
v0.5 -‐ Gradle Artifactory plugin
gradle artifactoryPublish
Wednesday, November 14, 12
Similar to Gradle uploadArchives plus ..
Publishes build info
Publishes artifact properties (metadata!)
v0.5 -‐ Gradle Artifactory plugin
Wednesday, November 14, 12
Publishing -‐ who owns it?
Build script
vs.
Build server
Wednesday, November 14, 12
v0.6 -‐ TeamCity Artifactory Plugin
Wednesday, November 14, 12
Publishing belongs to TeamCity
Publishes build environment (traceability!)
Published modules and their dependencies
Sends all artifacts in one go
Provides a bi-‐directional link:
TeamCity <=> Artifactory
v0.6 -‐ TeamCity Artifactory Plugin
Wednesday, November 14, 12
v0.7 -‐ Artifactory Release Mgmt
Wednesday, November 14, 12
Similar to Gradle release plugin plus ..
Release branch
Release process:
Staging : SNAPSHOT => RC
Promotion : RC => Release
Release history
v0.7 -‐ Artifactory Release Mgmt
Wednesday, November 14, 12
SNAPSHOTs => RC-‐1 ... RC-‐N => Release!
Traditional release process
Wednesday, November 14, 12
SNAPSHOTs => RC-‐1 ... RC-‐N => Release!
Traditional release process
Wednesday, November 14, 12
SNAPSHOTs => RC-‐1 ... RC-‐N => Release!
Traditional release process
Wednesday, November 14, 12
SNAPSHOTs => RC-‐1 ... RC-‐N => Release!
Traditional release process
Wednesday, November 14, 12
SNAPSHOTs => RC-‐1 ... RC-‐N => Release!
Problems:
RC builds are redundant, timely and risky
Version updating policy ..
SCM tagging and branching policy ..
Staging and promotion policy ..
Traditional release process
Wednesday, November 14, 12
SNAPSHOTs => RC-‐1 ... RC-‐N => Release!
Problems:
RC builds are redundant, timely and risky
Version updating policy ..
SCM tagging and branching policy ..
Staging and promotion policy ..
Traditional release process
Predefined!
Wednesday, November 14, 12
SNAPSHOTs => RC-‐1 ... RC-‐N => Release!
Solution: promotion of SNAPSHOTs!
Build as many SNAPSHOTs as needed
Pick one build and stage/promote its SNAPSHOT
Code your own release procedure
Traditional release process
Wednesday, November 14, 12
Execute in Artifactory
Lots of extension points
Rich Groovy DSL and Artifactory Public API
wiki.jfrog.org/javadocs/artifactory/latest/papi/
github.com/JFrogDev/artifactory-‐user-‐plugins
v0.8 -‐ Artifactory User Plugins
Wednesday, November 14, 12
Search for builds and artifacts
Manipulate, copy and move artifacts
Read build info
Execute custom promotion logic
Callable over HTTP using curl
Respond to Artifactory events
Run scheduled jobs
v0.8 -‐ Artifactory User Plugins
Wednesday, November 14, 12
Wednesday, November 14, 12
v0.1 -‐ Gradle Maven plugin -‐ local .m2 repository.
v0.2 -‐ Manual upload of artifacts
v0.3 -‐ Gradle Maven plugin -‐ remote repo deploy.
v0.4 -‐ Gradle release plugin -‐ checks, tag, version update.
v0.5 -‐ Gradle Artifactory plugin -‐ metadata, build info.
v0.6 -‐ TeamCity Artifactory plugin -‐ metadata, build info.
v0.7 -‐ TeamCity Artifactory plugin -‐ staging, promotion
v0.8 -‐ Artifactory user plugins, SNAPSHOTs promotion
Overview
Wednesday, November 14, 12
v0.1 -‐ Gradle Maven plugin -‐ local .m2 repository.
v0.2 -‐ Manual upload of artifacts
v0.3 -‐ Gradle Maven plugin -‐ remote repo deploy.
v0.4 -‐ Gradle release plugin -‐ checks, tag, version update.
v0.5 -‐ Gradle Artifactory plugin -‐ metadata, build info.
v0.6 -‐ TeamCity Artifactory plugin -‐ metadata, build info.
v0.7 -‐ TeamCity Artifactory plugin -‐ staging, promotion
v0.8 -‐ Artifactory user plugins, SNAPSHOTs promotion
Overview
Wednesday, November 14, 12
v0.1 -‐ Gradle Maven plugin -‐ local .m2 repository.
v0.2 -‐ Manual upload of artifacts
v0.3 -‐ Gradle Maven plugin -‐ remote repo deploy.
v0.4 -‐ Gradle release plugin -‐ checks, tag, version update.
v0.5 -‐ Gradle Artifactory plugin -‐ metadata, build info.
v0.6 -‐ TeamCity Artifactory plugin -‐ metadata, build info.
v0.7 -‐ TeamCity Artifactory plugin -‐ staging, promotion
v0.8 -‐ Artifactory user plugins, SNAPSHOTs promotion
Overview
Wednesday, November 14, 12
v0.1 -‐ Gradle Maven plugin -‐ local .m2 repository.
v0.2 -‐ Manual upload of artifacts
v0.3 -‐ Gradle Maven plugin -‐ remote repo deploy.
v0.4 -‐ Gradle release plugin -‐ checks, tag, version update.
v0.5 -‐ Gradle Artifactory plugin -‐ metadata, build info.
v0.6 -‐ TeamCity Artifactory plugin -‐ metadata, build info.
v0.7 -‐ TeamCity Artifactory plugin -‐ staging, promotion
v0.8 -‐ Artifactory user plugins, SNAPSHOTs promotion
Overview
Wednesday, November 14, 12
v0.1 -‐ goo.gl/UWrx4
v0.2 -‐ goo.gl/8eIQb
v0.3 -‐ goo.gl/UWrx4
v0.4 -‐ goo.gl/wFSrp
v0.5 -‐ goo.gl/LpH4M
v0.6 -‐ goo.gl/dA5dB
v0.7 -‐ goo.gl/E7RN1
v0.8 -‐ goo.gl/jSrQf
Overview
Wednesday, November 14, 12
Gradle (videos)
TeamCity (videos)
Artifactory (videos)
pinboard.in/u:evgenyg/t:release/
github.com/evgeny-‐goldin/demo-‐releases-‐plugin
github.com/evgeny-‐goldin/gradle-‐plugins
Resources
Wednesday, November 14, 12
Gradle plugins:
about -‐ adds “about” data to build artifacts
duplicates -‐ finds duplicates in your dependencies
kotlin -‐ builds Kotlin projects
teamcity -‐ builds TeamCity plugins
evgeny-‐goldin.com/wiki/Gradle_Plugins
Wednesday, November 14, 12
Gradle plugins (coming next):
crawler -‐ crawls the Web, checks for broken links
gitdump -‐ makes local archives of all your Git repos
node.js -‐ makes working with Node.js easy
roam -‐ makes your builds roam!
Follow me on Twitter -‐ @evgeny_goldin
Wednesday, November 14, 12
Thank you!
Wednesday, November 14, 12