Skip to content

Creating a patch release

Jonathan Meyer edited this page Sep 11, 2019 · 2 revisions

Patch Release

When we have a need to release a patch for Scale, the process is somewhat manual. It is made more complicated by the way the source is modified to include versions using a detached head to tag. One approach is to ensure the code is in a dedicated branch and then to rebase that branch onto the release tag. An alternative and more explicit approach is to cherry pick the individual commits onto tag. The latter approach is outlined below:

# Checkout the tag we want to patch based off of
git checkout 5.8.0

# We are now in a detached head state, so lets make a branch from the tag
git checkout -b 5.8.1-prerelease

# Now we are in a new branch and can grab the commits that we want to add.
# I identified commits by looking at the PR that went into master that I want to 
# incorporate into the patch release.
git cherry-pick 28edca3d945dc7bfc66bbd2f8a941a48eb36ecc7 ea8a185e9f8863bcf98d5e1aad10087da37c485e 03ee38650bc615de726269c8faf9b266f67cd120 d4dda158dd26a6b22a392441d960efe2b625b4e2 de14f7312a896cf0594f2c88203f2b90b85c48bc cae5c4f11885104a11a9ca0df83bedf89a30ef72 b0344d7034a30e77c7746c61f896e2253962e24a f9ebe814c2215f3e7916687196da6c38edfaf96f a29eb515d4d050f79680137a663025151751e21f c687ecd2e3680a6d61cc060affc6755c8d230670 ebc5fb05c92f245eccb8858edd3aa7abba687a05 9558d586c89e193efe1c769d11f79d44e84ce7dc

# Edit both scale/scale/__init__.py and scale/scale/__init__.py.template
# to match the version you are releasing.
git commit -a -m "Update version values for release 5.8.1"

# Do a docker build, test the release 
docker build -t yourhubaccount/scale .
docker push yourhubaccount/scale

# Once satisfied with the release tag and push
git tag 5.8.1
git push --tags

Transfer release tag

If we need to transfer the git repository across an airgap we can make a very small payload by using Git Bundle:

# Create commit bundle, adjust since days back to reflect time it took to make release
git bundle create 5.8.1.bundle --since=7.days 5.8.1
git bundle verify 5.8.1.bundle
# The above verify should show the parent commit and the tag

Now the generated bundle can be transferred to the target environment. Once there it can be restored into the git repository:

# apply tag to local repo (must be CWD)
git pull /file/path/5.8.1.bundle --tags
# push tag to remote
git push --tags

Assuming your target repo has the parent commit, your new tag will be made available.

Clone this wiki locally