Skip to content
This repository was archived by the owner on Aug 13, 2020. It is now read-only.

Developer Guide

Allan Mckenzie edited this page Aug 7, 2019 · 8 revisions

This section of the wiki contains information relevant to developers wishing to contribute to the project or to extend the framework.

Coding Style

Please use our coding style guidelines, as described in CJSCommonPlatform/styleguide. That project also includes settings files for commonly used editors.

Release Process

  1. Ensure the pom files do not reference SNAPSHOT versions of dependencies.

  2. Update the CHANGELOG.md file ready for the new release.

  3. Run the following command to perform the release using maven, ensure that you set the new and next release versions appropriately depending on the scope of the release (e.g. bug fixes, new features or fundamental modifications).

    mvn versions:set -DnewVersion=<release.version> versions:commit && git commit . -m 'Update to <release.version> for release' && git tag -a release-<release.version> -m 'Release <release.version>' && mvn versions:set -DnewVersion=<next.version>-SNAPSHOT versions:commit && git commit . -m 'Update to <next.version>-SNAPSHOT for development'

  4. Push the newly create tag and then wait for a few minutes to ensure the Continuous Integration build starts.

    git push --tags

  5. Push all changes to the repository.

    git push

  6. Update the Release Notes by copying the information from the CHANGELOG.md, see the previous release notes for desired format.

Release Command Script

Here is a small script that will compose and run the release command for you (step 3.).

To run: release <release.version> <next.version>

#!/bin/bash
if [ -z "$2" ]
  then
    echo "Usage: release <release.version> <next.version>"
    exit 1
fi

MAGENTA=$(tput setaf 5)
CYAN=$(tput setaf 6)
RED='\033[0;31m'
NO_COLOUR='\033[0m'

command="mvn versions:set -DnewVersion=$1 versions:commit && git commit . -m 'Update to $1 for release' && git tag -a release-$1 -m 'Release $1' && mvn versions:set -DnewVersion=$2-SNAPSHOT versions:commit && git commit . -m 'Update to $2-SNAPSHOT for development'"

echo
printf "${CYAN}Release version:\t${MAGENTA}$1${NO_COLOUR}\n"
printf "${CYAN}Next version:\t\t${MAGENTA}$2-SNAPSHOT${NO_COLOUR}\n"
echo
printf "${CYAN}Release command:${NO_COLOUR}\n"
printf "${RED}$command${NO_COLOUR}\n"
echo
read -p "Execute this command [y/n]? " -n 1 -r
echo  
  
if [[ $REPLY =~ ^[Yy]$ ]]
then
    eval $command
fi