Minor-release-per-branch release strategy for Docker image projects built by codefresh.io
819
This repository contains shell (sh) scripts that assist in implementing a release management strategy that is based on one release branch per minor version.
In this strategy, the master branch contains the latest & greatest code, and branches are created for each minor version (vx.y) and all patches for that release go into its minor branch.
TL;DR: This is a minor-release-per-branch strategy, and all that the scripts do is manipulate versions, create release commits & tags, and push so that your CI/CD process can actually perform releases based on branch & tag names. You can override certain defaults; see the
release-xxxscripts for more information, or issue./release-xxx --helpto get usage information.
We currently support release management for
release-chart)Dockerfile's LABEL directive with a version label (release-image)codefresh.yml (release-image-codefresh)release-nodejs) using package.jsonVERSION file (by any name)If you need to support other project types, see below for developer information.
master is pre (ie, 1.0.0-pre.0), and is not yet configurable.rc for "release candidate" (ie, 1.0.0-rc.0), and is not yet configurable.master branch always contains the latest & greatest code line. The name of this branch is configurable.origin, but is configurable.git cherry-picked into your master branch, or even backported to prior release branches.git.master branch.
0.1.0-pre.0.0, like 1.0.0-pre.0 or whatever you need.master with the command ./release-xxx pre in the master branch.
master branch with ./release-xxx rc.
vx.y where x is your master branch's current major version and y is the minor version. The initial version in the vx.y branch will have the suffix -rc.0, which will be released, then it will be immediately bumped to -rc.1 in preparation for your next release candidate.master; git cherry-pick is a simple tool with which to do that../release-xxx minor.
vx.y.0, and the script will bump your prerelease number in the release branch to x.y.1-rc.0.master as you see fit../release-xxx patch or prereleases with ./release-xxx rc.master for your next minor release, vx.z where z is y + 1.You need to have a Unix-like system with git & docker installed.
You can even reference the raw script content in your own scripts in order to stay up to date if you'd like to, piping them to sh for execution (if you trust doing that):
$ VERSION=master \curl -sSL \
https://raw.githubusercontent.com/SciSpike/release-mgmt/$VERSION/release-xxx | \
sh -s -- pre # or rc, minor, ...`
You can also forgo all dependencies except docker and use this strategy via its Docker containers, as these scripts have been Dockerized under the scispike organization on Docker Hub.
For example, see https://hub.docker.com/r/scispike/release-nodejs & similar Docker repositories.
All you really have to do is map a volume containing the root of your git repo to /gitrepo and set the EMAIL environment variable.
You might also want to include other environment variables supported by git; see https://git-scm.com/book/en/v2/Git-Internals-Environment-Variables.
If your current directory is the root of your git repo:
$ docker run --rm -i -v "$PWD:/gitrepo" -e [email protected] scispike/release-xxx pre # or rc, minor, patch, ...
Just replace xxx above with image-codefresh, chart, nodejs, version, or whatever else we support in the future.
test/
test/test-all.shrelease-xxx, xxx.Dockerfile, VERSION-xxx, & test/xxx from an existing release script to make a new one, then remember to
test/test-all.sh to add your new type to those testedscispike/release-xxx similar to an existing one./release xxx level where xxx is your type (nodejs, version, ...) & level is the release level (pre, rc, ...)NOTE: this is a monorepo, so tags & branches are prefixed with types in order to distinguish them from one another! The Docker Hub build settings for the various repositories leverage this to only publish what's necessary for that respective repository.
Content type
Image
Digest
Size
27.6 MB
Last updated
over 7 years ago
docker pull scispike/release-image-codefresh:0.4.0