This repo contains some zx scripts to execute the different release steps for APIM.
It will allow you to run these pipeline on CircleCI:
-
Release
-
Package Zip
-
Docker and RPMs
-
Generate changelog
-
Nexus Sync
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
releasefolder to create a.envfile 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 npm install
Thanks to package.json, you can run those scripts as simple npm commands (do not forget to use npm i before starting).
Each of the commands needs:
-
A
CIRCLECI_TOKENin.envfile -
the
--versionparameter
Optional flag:
-
--dry-run: allow to run the pipeline in dry run mode (except fornexus_syncwhich does not have this mode)
Each commands, when successful, will guide you to the next command to run, for example:
When it's done, run 'npm run nexus_sync -- --version=3.15.11'Here are the steps to run to fully release APIM (Releasing 3.15.11, in the following example):
# 1. Release
npm run release -- --version=3.15.11# 2. Zip
npm run package_zip -- --version=3.15.11# 3. Docker & RPMS
# You can also provide the `--latest` parameter to flag the image as `latest`.
npm run docker_rpms -- --version=3.15.11# 4. Changelog
npm run changelog -- --version=3.15.11# 5. Nexus
npm run nexus_sync -- --version=3.15.11To 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).