Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Note, as of 12/7/2011 we have decided not to use tagging or releases.  The verbiage around those activites has been stricken below.

Notes on deployment policies

  • Major version number will remain 0 until we make a "marketing" decision that we are calling Synapse production instead of under development. Minor version number will correspond to Sprint number.
  • Code should never be deployed to any production system on Amazon directly from a development environment build.  Neither should you ever do a maven deploy directly from a development environment.  All deployed artifacts should be produced by a successful Bamboo build and deployed to Artifactory by that build process.  Only deploy artifacts to AWS that have been obtained from Artifactory
  • Code from the tip of trunk or a release branch will always have a maven version of 0.x-SNAPSHOT where x is the sprint (minor version) number.  Snapshots are stored in libs-snapshots-local/org/sagebionetworks/<path-to-artifact>.  Note that every successful Bamboo build overwrites artifactory's snapshots location, so this artifact is volatile.  However, Maven does put the SVN version number in the manifest of the .jars and .wars it builds, and our deployment tool pulls out the build number and puts it in the name of the versions it deploys to beanstalk, so it is always possible to find the build number of deployed code and determine whether a specific check-in occurred before or after deployment.
  • Trunk plus active release branches should have a Bamboo build watching them and building on every check-in. 
  • For weekly dev-team integration deployments to staging, it's not necessary to create a new tag.  We will simply deploy snapshots off trunk, and include the svn build number in the version label when deploying to Beanstalk.  Any deployments to customer-facing stacks should be tagged in SVN and archived in Artifactory.  This is done by giving creating a tag in SVN and checking in poms with a version number of 0.x.y, where y is incremented every time we want to snapshot a build. Artifacts for numbered releases are stored in Artifactory in libs-releases-local/org/sagebionetworks/<path-to-artifact>.  Note that the branching and tagging patterns described below are designed so that we never overwrite numbered versions in Artifactory after they are generated, and consequently we have archived versions of all the code that we have deployed already built that we can roll back to earlier versions quickly when needed.

Creating a Tag off Trunk

As we work in trunk, we will periodically want to tag and deploy builds of Synapse.  Assume we are starting with trunk labeled Synapse-0.x-SNAPSHOT.  The procedure is:

  1. Verify with platform team that all required code changes are checked in, and that nobody has any check-in that cause temporary stability issues (this latter case should normally be done in a development branch and merged into trunk when stable.  This lets us always quickly deploy out of trunk if we need to.)
  2. Verify that most recent check-in results in a clean Bamboo build of trunk
  3. Do a svn copy of trunk to tags/Synapse-0.x.y, where y is one higher than previous number, or zero if first release of a sprint. 
  4. Reconfigure the Bamboo build of trunk (the "Repository Path" field under "Configuration") to point to tags/Synapse-0.x.y.
  5. Check out tags/Synapse-0.x.y, then:
    1. edit  tools/SynapseDeployer/pomVersioner.py so that oldVersion=0.x-SNAPSHOT, newVersion=0.x.y, and startPath 'points' to your local copy, then run pomVersioner.py. 
    2. Validate that changes to poms and any version info in R client makes sense
    3. Check this into SVN.  Eclipse will give you a warning that you shouldn't be checking in to a tag.  Do it anyway.
  6. Bamboo should now run a clean build of the tag, which will end up as a permanent versioned artifact in artifactory.
  7. Reconfigure the Bamboo build to point back to trunk
  8. Delete the tag code from your workspace so you never accidentally modify the tagged version again.
  9. Clean labeled artifacts are sitting in artifactory libs-releases-local/org/sagebionetworks/<path-to-artifact>/0.x.y

Creating a Branch at the end of a Sprint

...

  1. Developers are responsible for down-merging patches to the branch from trunk (or vice versa as appropriate).
  2. Verify that the most recent check-in on the branch resulted in a clean Bamboo build, and verify with the developer who created the patch that it is in fact checked in.
  3. Do a svn copy of branches/Synapse-0.x to tags/Synapse-0.x.y
  4. Reconfigure the Bamboo build of the branch (the "Repository Path" field under "Configuration") to point to tags/Synapse-0.x.y.
  5. Check out tags/Synapse-0.x.y, then:
    1. edit  tools/SynapseDeployer/pomVersioner.py so that oldVersion=0.x-SNAPSHOT, newVersion=0.x.y, and startPath 'points' to your local copy, then run pomVersioner.py. 
    2. Validate that changes to poms and any version info in R client makes sense
    3. Check this into SVN.  Eclipse will give you a warning that you shouldn't be checking in to a tag.  Do it anyway.
  6. Bamboo should now run a clean build of the tag, which will end up as a permanent versioned artifact in artifactory.
  7. Reconfigure the Bamboo build to point back to the branch
  8. Delete the tag code from your workspace so you never accidentally modify the tagged version again.
  9. Clean labeled artifacts are sitting in artifactory libs-releases-local/org/sagebionetworks/<path-to-artifact>/0.x.y