This repo contains some zx scripts to execute the different release steps for APIM.
To run the scripts, you need to have:
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:-
Go to https://app.circleci.com/settings/user/tokens, create a token and copy it
-
Run the following command in the
release
folder to create a.env
file with the token:
-
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
Before apply the release, and mainly during each fix/feat/… on helm chart, you have to ensure some prerequisites:
-
Add changelog entry on
helm/Chart.yaml
file in sectionartifacthub.io/changes
. Notice that it is cleanup during release process.-
This is used in artifacthub.io changelog
-
-
At least on master branch: update the changelog in right version. This make the master branch the reference for each change on all version.
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 fornexus_sync
which does not have this mode) -
--latest
: to tag the docker image as thelatest
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
-
It will allow you to manually trigger these workflows on CircleCI:
-
Release
-
Package Zip
-
Docker and RPMs
-
Helm Chart
-
Generate changelog
-
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 fornexus_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):
-
yarn release --version=3.19.8
-
yarn package_zip --version=3.19.8
: -
yarn docker_rpms --version=3.19.8
: You can also provide the--latest
parameter to flag the image aslatest
. -
yarn helm_chart --version=3.19.8
-
yarn release_notes --version=3.19.8
-
yarn nexus_sync --version=3.19.8
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).