Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Continuous integration

gillerr edited this page Jun 23, 2020 · 1 revision

Continuous integration

This page describes how the UI code is being integrated in our 4 environments which are

GitHub

The present repository hosts the all code related to the CovidCode-UI except for the Frutiger font because its license doesn't allows it to be hosted on a public repository. Commits can only be pushed on the master branch through a Pull Request that will automatically be linted, tested and built. If any of those steps fails, the PR cannot be merged. Finally, new versions have to be manually tagged with the appropriate version number.

Jenkins

The actual deployment happens internally in the FOITT through some Jenkins pipelines.

Release

A pipeline called bag_covidcode.HA-UI-Release is to be manually triggered each time a new version is desired. This pipeline will checkout the desired GitHub tag and build corresponding releases for each environments. Each release will then be stored on Nexus, our internal NPM repository. The pipeline works as follow:

  1. chose the GitHub tag to checkout: <tag>
  2. set the build name to the chosen tag
  3. clone the GitHub repository: git clone https://github.com/admin-ch/CovidCode-UI.git
  4. checkout the chosen tag from GitHub: git checkout tags/<tag>
  5. install dependencies: npm ci
  6. optionally run unit tests: npm test -- --prod
  7. optionally run sonarQube analysis
  8. for each environment <env>
    1. build the project: npm run build -- --configuration=<env>
    2. add Frutiger font files
    3. add a package.json with version set to <tag>-<env>
    4. publish the package on Nexus, our internal NPM repository: npm publish

Deploy

Another pipeline, called bag_covidcode.HA-UI-Deploy, which is also triggered manually, is responsible of actually deploying a prepared release. This pipeline will simply download a release form Nexus and deploy it on the desired environment. It works as follow:

  1. chose the version to deploy and the target environment: <version> and <env>
  2. set the build name to the chosen version and environment
  3. download the release: npm i covidcode-ui@<version>-<env>
  4. add .npmrc and manifest files
  5. deploy it on Cloud Foundry
  6. run integration tests on ABN environment (if deployed on ABN)

Dev

A last pipeline, called bag_covidcode.HA-UI-Dev, is used to quickly deploy a branch on the DEV environment. It will checkout the desired branch, build and deploy it on DEV. It works as follow:

  1. chose the branch to deploy: <branch>
  2. set the build name to the chosen branch
  3. clone the GitHub repository: git clone https://github.com/admin-ch/CovidCode-UI.git
  4. checkout the chosen branch from GitHub: git checkout <branch>
  5. install dependencies: npm ci
  6. build the project: npm run build -- --configuration=dev
  7. add Frutiger font files
  8. add .npmrc and manifest files
  9. deploy it on Cloud foundry
  10. optionally run integration tests on DEV environment
Clone this wiki locally