Release It!

42
Release It! Using Gradle, TeamCity and Artifactory for making releases the new way Evgeny Goldin (@evgeny_goldin) November 14, 2012 Wednesday, November 14, 12

description

Using Gradle, TeamCity and Artifactory for making releases the new way.

Transcript of Release It!

Page 1: 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

Page 2: Release It!

Evgeny  Goldin

Tel-­‐Aviv  =>  Munich  =>  Berlin

Java  /  Maven  =>  Groovy  /  Gradle

SCM  at  Trademob

evgeny-­‐goldin.com/wiki

github.com/evgeny-­‐goldin

GroovyMag,  Gr8Conf

[email protected]

Wednesday, November 14, 12

Page 3: Release It!

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

Page 4: Release It!

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

Page 5: Release It!

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

Page 6: Release It!

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

Page 8: Release It!

Build  environment  =  build  tool  +  build  server  +  binaries  repo

Wednesday, November 14, 12

Page 9: Release It!

     apply  plugin:  'about'

Wednesday, November 14, 12

Page 10: Release It!

v0.1  -­‐  Local  Maven  repository

                                                                     

                                 gradle  install

Wednesday, November 14, 12

Page 11: Release It!

                                                                     

                               

v  0.2  -­‐  Manual  Artifacts  Upload

Wednesday, November 14, 12

Page 12: Release It!

v0.3  -­‐  Maven  repo  deploy

                                                                     

     gradle  uploadArchives

Wednesday, November 14, 12

Page 13: Release It!

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

Page 14: Release It!

v0.4  -­‐  Gradle  release  plugin

                                                                     

                               gradle  release

Wednesday, November 14, 12

Page 15: Release It!

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

Page 16: Release It!

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

Page 17: Release It!

v0.5  -­‐  Gradle  Artifactory  plugin

                                                                     

gradle  artifactoryPublish

Wednesday, November 14, 12

Page 18: Release It!

Similar  to  Gradle  uploadArchives  plus  ..

Publishes  build  info

Publishes  artifact  properties  (metadata!)

v0.5  -­‐  Gradle  Artifactory  plugin

Wednesday, November 14, 12

Page 19: Release It!

Publishing  -­‐  who  owns  it?

Build  script  

vs.

Build  server

Wednesday, November 14, 12

Page 20: Release It!

v0.6  -­‐  TeamCity  Artifactory  Plugin

Wednesday, November 14, 12

Page 21: Release It!

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

Page 22: Release It!

v0.7  -­‐  Artifactory  Release  Mgmt

Wednesday, November 14, 12

Page 23: Release It!

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

Page 24: Release It!

SNAPSHOTs  =>  RC-­‐1  ...  RC-­‐N  =>  Release!

Traditional  release  process

Wednesday, November 14, 12

Page 25: Release It!

SNAPSHOTs  =>  RC-­‐1  ...  RC-­‐N  =>  Release!

Traditional  release  process

Wednesday, November 14, 12

Page 26: Release It!

SNAPSHOTs  =>  RC-­‐1  ...  RC-­‐N  =>  Release!

Traditional  release  process

Wednesday, November 14, 12

Page 27: Release It!

SNAPSHOTs  =>  RC-­‐1  ...  RC-­‐N  =>  Release!

Traditional  release  process

Wednesday, November 14, 12

Page 28: Release It!

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

Page 29: Release It!

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

Page 30: Release It!

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

Page 31: Release It!

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

Page 32: Release It!

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

Page 33: Release It!

Wednesday, November 14, 12

Page 34: Release It!

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

Page 35: Release It!

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

Page 36: Release It!

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

Page 37: Release It!

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

Page 38: Release It!

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

Page 40: Release It!

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

Page 41: Release It!

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

Page 42: Release It!

Thank  you!

Wednesday, November 14, 12