Skip to main content

Versioning the Project

How to Change the Version of the Project

To update the project version, run the following command. This process will update the necessary files, including Jenkinsfile, lerna.json, eas.json and values-dev.yaml, based on the provided version. For instance, to change from v9 to v9.1:

Run

cd tools
node deployVersionUpdate.js v9.1
git checkout -b develop9-1
git add .
git commit -m 'prep for version 9.1'
  1. Jenkinsfile
    The Jenkinsfile will be updated with the new version in branch names and variables.

    Example:

@@ -13,17 +13,17 @@ pipeline {
- string(name: 'VERSION', defaultValue: 'v9', description: 'version of the deployment', trim: true)
+ string(name: 'VERSION', defaultValue: 'v9-1', description: 'version of the deployment', trim: true)
string(name: 'HEMERA_LOG_LEVEL', defaultValue: 'info', description: 'log level for hemera')
string(name: 'LOG_LEVEL', defaultValue: 'info', description: 'log level')
string(name: 'DEPLOYMENT_PATH', defaultValue: '/servers', description: 'folder path to load helm charts')
- string(name: 'PUBLISH_BRANCH', defaultValue: 'devpublish', description: 'the publish branch for packages release')
+ string(name: 'PUBLISH_BRANCH', defaultValue: 'devpublish9-1', description: 'the publish branch for packages release')
....
- string(name: 'REPOSITORY_BRANCH', defaultValue: 'develop', description: 'the branch with changes')
- string(name: 'DEVELOP_BRANCH', defaultValue: 'develop', description: 'the branch for the development')
+ string(name: 'REPOSITORY_BRANCH', defaultValue: 'develop9-1', description: 'the branch with changes')
+ string(name: 'DEVELOP_BRANCH', defaultValue: 'develop9-1', description: 'the branch for the development')
string(name: 'MASTER_BRANCH', defaultValue: 'master', description: 'Master branch as default branch for production.')
  1. lerna.json
    lerna.json will be updated with the new version and appropriate branch names under allowBranch.

    Example:

@@ -17,7 +17,8 @@
"devpublish7",
"devpublish8",
"devpublish9",
- "devpublish9"
+ "devpublish9",
+ "devpublish9-1"
],
"message": "chore(release): publish",
"ignoreChanges": ["**/__fixtures__/**", "**/__tests__/**", "**/*.md", "**/example/**"]
@@ -38,7 +39,9 @@
"devpublish8",
"devpublish9",
"devpublish9",
- "develop9"
+ "develop9",
+ "devpublish9-1",
+ "develop9-1"
],
"private": true,
"conventionalCommits": true,
@@ -48,5 +51,5 @@
"npmClient": "yarn",
"useNx": true,
"packages": ["packages-modules/**", "packages/**", "servers/*", "portable-devices/*"],
- "version": "9.0.3"
+ "version": "9.1.0"
}
  1. portable-devices/mobile/eas.json This file will update the GRAPHQL_URL and/or CLIENT_URL fields.

    Example:

-    \"GRAPHQL_URL\": \"https://ideback.example-namespace-v1.cdebase.io/graphql\",
+ \"GRAPHQL_URL\": \"https://idefront.example-namespace-v9-1.cdebase.io/graphql\",
  1. values-dev.yaml
    This file will update the VERSION, CONNECTION_ID, and CLIENT_URL fields.

    Example:

frontend:
env:
AUTH0_TOKEN_GRANTED_TIME: "2592000000"
- CLIENT_URL: "https://idefront.example-namespace-v9.cdebase.dev"
+ CLIENT_URL: "https://idefront.example-namespace-v9-1.cdebase.dev"
STRIPE_PUBLISHABLE_KEY: ""
...
env:
GA_ID: "GXXXXXX"
- CONNECTION_ID: v9
+ CONNECTION_ID: v9.1
CONFIG_PATH: "/tmp"
....
- CLIENT_URL: "https://idefront.example-namespace-v9.cdebase.dev"
- VERSION: v9
+ CLIENT_URL: "https://idefront.example-namespace-v9-1.cdebase.dev"
+ VERSION: v9-1
external:

Scripts

The versioning command deployVersionUpdate.js sequentially calls these scripts:

  • updateJenkinsfileVersion.js: Updates Jenkinsfile with the new version in branches and environment variables【14†source】.
  • updateLernaVersion.js: Adjusts lerna.json to reflect the new version and branch configurations【15†source】.
  • updateYamlSettings.js: Updates values-dev.yaml by modifying fields like VERSION, CONNECTION_ID, and CLIENT_URL【16†source】.