Each environment will have its own pipeline on the CAW’s Jenkins server. The project name on Jenkins will be the same as the app name. Inside the Jenkins project, you will create one pipeline per environment (or branch) with the name <app name>-<environment name>
There will be only one common Jenkins build script for the pipelines of all the environments. The branch name and other config parameters like the deployment bucket name, AWS keys etc.. will be configured in Jenkins server as config keys (plain and secret) and sent as variables to the script.
The Jenkins build script will be committed as part of the codebase in a folder called build-scripts
<aside> ⛔ Never commit any keys or buckets names in the Jenkins file in the source control
</aside>
The Jenkins script will, at a high level, perform the following steps
BUILD_NUMBER
part in X.Y.Z_BUILD_NUMBER
) to the current Pipeline Build Number and update the version in env file. Set the same version in package.json file as well (variable is called version
).In each Jenkins pipeline, we will have a build parameter called "forceUpdate". The default value of this variable is false.
Create a new file called manifest.json and add it to the assets folder. The manifest.json will have the following structure
{
version: <the version number from package.json>
forceUpdate: <the value of the build parameters>