Skip to content

Latest commit

 

History

History

release

Release process

📝 Description

This repo contains some zx scripts to execute the different release steps for APIM.

🛠 Requirement

To run the scripts, you need to have:

  • Node.js >= 16.0.0 (configured in .nvmrc with v18.4.0)

  • zx, to install it you just have to run:

npm i -g zx
# Check everything is ok:
zx -v
  • A dotenv file containing the variable CIRCLECI_TOKEN, which is your personal token on CircleCI:

touch .env && echo "CIRCLECI_TOKEN=[YOUR_TOKEN]" > .env
  • Some dependencies to run the scripts, you can install them with:

# In the `release` folder
yarn install

🛠 Pre-Release

Helm changelog steps

Before apply the release, and mainly during each fix/feat/…​ on helm chart, you have to ensure some prerequisites:

  1. Add changelog entry on helm/Chart.yaml file in section artifacthub.io/changes. Notice that it is cleanup during release process.

    1. This is used in artifacthub.io changelog

  2. At least on master branch: update the changelog in right version. This make the master branch the reference for each change on all version.

🏁 Usage

⚡️ Full release for the win!

Thanks to package.json, you can run those scripts as simple yarn commands (do not forget to use yarn install before starting).

Each of the commands needs:

  • A CIRCLECI_TOKEN in .env file

  • the --version parameter

Optional flag:

  • --dry-run: allow to run the pipeline in dry run mode (except for nexus_sync which does not have this mode)

  • --latest: to tag the docker image as the latest

Here is the command to fully release APIM (Releasing 3.15.11, in the following example):

yarn full_release --version=3.15.11: You can also provide the --latest parameter to flag the image as latest.

IMPORTANT

If alpha released have been created and you want to release a minor version, don’t forget to update:

  • pom.xml: replace <sha1>alpha.x</sha1> by <sha1/>

  • helm/Chart.yml: remove the alpha qualifier from the version

🐌 Step by step release

It will allow you to manually trigger these workflows on CircleCI:

  1. Release

  2. Package Zip

  3. Docker and RPMs

  4. Helm Chart

  5. Generate changelog

  6. Nexus Sync

This is the legacy process making you execute each step manually

Thanks to package.json, you can run those scripts as simple yarn commands (do not forget to use yarn install before starting).

Each of the commands needs:

  • A CIRCLECI_TOKEN in .env file

  • the --version parameter

Optional flag:

  • --dry-run: allow to run the pipeline in dry run mode (except for nexus_sync which does not have this mode)

Each command, when successful, will guide you to the next command to run, for example:

When it's done, run 'yarn nexus_sync --version=3.19.8'

Here are the steps to run to fully release APIM (Releasing 3.19.8, in the following example):

  1. yarn release --version=3.19.8

  2. yarn package_zip --version=3.19.8:

  3. yarn docker_rpms --version=3.19.8: You can also provide the --latest parameter to flag the image as latest.

  4. yarn helm_chart --version=3.19.8

  5. yarn release_notes --version=3.19.8

  6. yarn nexus_sync --version=3.19.8

🧪 Handle pre-version releases

To create a pre-version release (like alpha, beta, RC`, GA, …​), you just have to change the <sha1/> tag in pom.xml file.
This tag MUST be of the form: -NAME.VERSION (e.g. -alpha.1, -RC.3, …​)

    <!-- Version properties -->
    <revision>3.20.0</revision>
    <sha1>-alpha.1</sha1>
    <changelist>-SNAPSHOT</changelist>

Then, follow instructions of [Usage] with --version=3.20.0-alpha.1.
The version of the modifier will be automatically increased. (3.20.0-alpha.2 in the example above).