Adding a new version branch and other post-release tasks

 

Overview

As each official CONNECT version is released, tasks must be completed to prepare CONNECT for its next cycle to ensure that the integrity of each separate, fully-tested, easily implementable CONNECT version is maintained. This is also important in case newer code contributions need to be rolled back. The following is a list of tasks that need to be completed after each release to keep each version, official or non-official, fully intact with the appropriate common types, web services, Admin GUI versions, database scripts, etc. for that particular code compilation.

Pre-Release Checklist

  1. Make sure all the final common libraries (web Services, common Types) are uploaded to the maven repository (Try to automate this) 
  2. Create wiki/space placeholders for next release once the Release name is identified (major vs minor)
  3. Create a git tag for the release commit to produce a binary for testing

Post-Release Checklist

  1. Make sure all the new Regression Suites added are moved to their respective directories (from new to Standard or Bimodal or Manual or Pass-through)
  2. Make sure the released version's final branches are created (both integration and final branch).(Applicable for major and minor releases only)
  3. Close release version in Jira
  4. Creating ticket to update Readme.md and History Page to reflect the release version

Team Setup

Our team account has been set up with the following Sonatype JIRA ticket: https://issues.sonatype.org/browse/OSSRH-4335

The current process is to deploy and release CONNECTCommonTypes and CONNECT-Webservices.  Full directions on deploying and releasing a binary with Sonatype can be found here.

Deploy Setup

The machine use for deploying the binaries needs the following PGP and Maven configuration changes:

PGP

Binaries that are released to Maven Central must be PGP-signed.  Using the steps below as a guide, please follow the Sonatype directions for Working with PGP Signatures.

  1. Check if you have GPG installed in your machine. If you are a developer, most likely GIT installation will have gpg.exe. To check, type $where gpg.exe in your Git Bash. If you see any listing, proceed with Step 3 to generate keys through command line.
  2. Install PGP.
    Note: Download link for Windows OS http://gpg4win.org/download.html
  3. Generate a default key pair (i.e., select the (default) options when available).  You'll need to supply some user information and a password (to be used later).
    1. e.g., gpg2 --gen-key
  4. List the signatures.
    1. e.g.: gpg2 --list-keys
  5. Publish the signatures from the list (both the pub and sub signatures).
    1. e.g.: gpg2 --keyserver hkp://pgp.mit.edu --send-keys <pub-key>
    2. e.g.: gpg2 --keyserver hkp://pgp.mit.edu --send-keys <sub-key>

Maven Settings

Create or edit the settings.xml maven file.  For local configuration (per user), the file should be at ${user.home}\.m2 (e.g., C:\\Users\johndoe\.m2).  For global configuration, the file should be at ${maven.root}/conf (e.g., /opt/apache-maven-3.2.5/conf).

The settings file must contain CONNECT's authentication information for the Sonatype repositories, as shown in the following example (Note: if you get an unauthorized error, try with id "ossrh"):

Note: CONNECT Team username/password will be provided by Team members.

settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <localRepository>${user.home}/.m2/repository</localRepository>

  <servers>
    <server>
      <id>sonatype-nexus-staging</id>
      <username>connect-sonatype-id</username>
      <password>connect-sonatype-pwd</password>
    </server>

    <server>
      <id>ossrh</id>
      <username>connect-sonatype-id</username>
      <password>connect-sonatype-pwd</password>
    </server>
  </servers>
</settings>

Building and Preparing

The following will need to be done for both the CommonTypes and CONNECT-Webservices projects (both can be pulled down from the CONNECT GitHub repository).  Repeat all steps for each project, step 3 in both sections below clarifies the different commands for each project.  CommonTypes must be done first.

The steps should be performed with both git and maven available on the system path.

Note: <version to release> and <tag name> are the non-snapshot version (e.g., 4.1.1); <next development version> is the next snapshot version (e.g., 4.1.2-SNAPSHOT).

CommonTypes

  1. Run the following Maven commands from the project root, supplying your PGP password when prompted:
    1. mvn release:clean
    2. mvn release:prepare -DreleaseVersion=<version to release> -Dtag=<tag name> -DdevelopmentVersion=<next development version>
  2. Push to the git repository using your Github credentials (the version changes have already been committed by previous step).
    1. git push origin
    2. git push origin --tags
  3. Maven deploy to Sonatype repository:
    1. mvn release:perform -DworkingDirectory=<versionToRelease> -DconnectionUrl=scm:git:https://github.com/CONNECT-Solution/Common-Types.git

Webservices

  1. In the Webservices POM, update the CommonTypes version to reflect the newly-released version.  Stage and commit this change.
  2. Repeat steps 1 & 2 from the CommonTypes instructions above, using the CONNECT-Webservices repo and versions.
  3. Maven deploy to Sonatype repository:
    1. mvn release:perform -DworkingDirectory=<versionToRelease> -DconnectionUrl=scm:git:https://github.com/CONNECT-Solution/CONNECT-Webservices.git 

Pushing to Maven Central

The last step is to release the binaries at Sonatype.  First log in here.  Follow the Sonatype deploy guidelines.

Basically, you'll need to select the staging repositories after logging in.  Select the connectopensource repository, and choose close from the top.  Takes about a minute, refresh to see it update.  Once close is complete, select release (leave drop after release option marked).