Skip to content

How to Release

Dimitri Koshkin edited this page Apr 13, 2023 · 24 revisions

How to Release

We use the convention ${UPSTREAM_VERSION}-d2iq.${DOWNSTREAM_VERSION}. For example, if latest tagged upstream version is v1.1.3, our first release with that version is v1.1.3-d2iq.0, our second release is v1.1.3-d2iq.1, and so on.

We should keep up to date with upstream. If there is a new upstream version, we should pull in the changes.

Prepare Environment

# Fetch all tags from upstream
git fetch upstream 'refs/tags/*:refs/tags/*'

# Use the upstream tag,e.g. v1.2.2
export UPSTREAM_VERSION=

# Start with 0, and increment for subsequent releases that use the same upstream patch version.
export DOWNSTREAM_RELEASE_VERSION=

export VERSION=${UPSTREAM_VERSION}-d2iq.${DOWNSTREAM_RELEASE_VERSION}
export RELEASE_TAG=${VERSION}

# Override upstream CAPI controller manager container image defaults
export REGISTRY=docker.io/mesosphere
export PROD_REGISTRY=$REGISTRY
export TAG=$VERSION

# Override upstream CAPD controller manager container image defaults
export STAGING_REGISTRY=$REGISTRY

Tag and push

# NOTE origin is assumed to be the remote that points to https://github.com/mesosphere/cluster-api

# checkout the branch
git checkout -b d2iq/release-${UPSTREAM_VERSION#v} ${UPSTREAM_VERSION}

# cherry-pick d2iq changes
git cherry-pick 2daeb1cd1396b52a038fb43d062fe4747164869e 7a078fa87d363622c9658cf39c622c1ffe135d8a 12657ebb85c29ce1200cae5aa222cac35180f7de 5d3a551a1f349f9bfb1265cc23a451991bc5079f 2edb110f82edd05d605ee573ffa0f96c7c2ed1f1 f632d09034b9719d37311dea4e5cd3f215022b3b e34cbfc9c6d1fe21daf9fb28b1de65be3b100dc1 df752366d2e119f4104ee9a9e260aab103f1b00b 1f41ac7e937752625862af75dc9a6f8aa501ea9a 967896fdf58a77a349a707b3356f268dc350d494 13d66294bd57c8bcee49e22630e3a1f5d3f54af7 7411fb6052f7105828a9e42b90ae3a013048c850 ce2ee611b9987e4f6fa6330732846a411ca78fd4 4e15024dd5106da5946932fc405ce77446f04866 00d89a1b0794737620609420a4c7ec3913e2b616 c1091c47bae3a5ee552bc414fe4176a0975c39a0 e6e64e8c2f3b03fb8c0cea5cf8214a81e61e610b 95e594fcbaedec1ff531cd20f8bcbaf82ec88b6d e6e64e8c2f3b03fb8c0cea5cf8214a81e61e610b

# push release branch
git push origin d2iq/release-${UPSTREAM_VERSION#v}

# tag and push the new release
git tag --sign ${VERSION} -m "${VERSION}"
git push origin ${VERSION}

# tag and push the new test release (for CAPD)
git tag --sign test/${VERSION} -m "${VERSION}"
git push origin test/${VERSION}

Build and push container images (for manual release only)

# NOTE Each arch requires its own registry. So far, we only have registries for amd64 and arm64.
# Build the CAPI and CAPD images for every arch
make ALL_ARCH="amd64 arm64" docker-build-all docker-capd-build-all

# Push the CAPI and CAPD images for every arch
make ALL_ARCH="amd64 arm64" docker-push-all docker-capd-push-all

Create the GitHub Release (for manual release only)

# Build the CAPI and CAPD release artifacts
make release

# Create the GitHub release and push the artifacts
export GITHUB_TOKEN=<>
gh release create --repo mesosphere/cluster-api --title ${VERSION} --notes "${VERSION}" ${VERSION}
gh release upload --repo mesosphere/cluster-api ${VERSION} out/*
Clone this wiki locally