The diagram below illustrates a CI/CD workflow implemented on OLP.
This workflow consists of the following high-level stages:
- local development and testing
- building and testing in a CI environment
- deploying to the HERE platform test environment
- deploying to the HERE platform production environment
The last three stages each have their own environment. While there are many ways companies can set up their CI system(s), the instructions below assume that all stages are implemented in Jenkins continuous integration system.
The building and testing phases in the CI environment are as follows:
- Pre Submit Validation, which runs validation checks against new commits
- Post Submit Verification, which occurs when the commit gets merged into the development branch
Pre Submit Validation skips publishing artifacts and deploying to the test environment since it only verifies that the changes made by a developer don't break the code before it enters the development branch. In this workflow, both phases are handled in Gerrit with Plugin-based Validation in conjunction with Jenkins. Pre Submit Validation is an extra phase and is not mandatory in the scope of these instructions.
Validating deployment to the test environment and the production environment requires a series of steps. In this example, Jenkins sets up and tears down the test environment and deploys the artifact(s) to the production environment. The main steps in the CI/CD workflow are:
- Build and Test - Jenkins fetches the code changes pushed to a version control system by developers, builds an artifact and tests it. This stage is automated via Jenkins and executed directly in that environment. Jenkins can access data on OLP, but no resources are running on the platform. For an example implementation, see the Example Build and Test Implementation.
- Validate in test environment - Jenkins deploys artifacts successfully passing the first step to the test environment. Execution is on OLP. For an example implementation, see the Example Validation Implementation.
- Deploy to production environment - Jenkins deploys artifacts successfully passing the second step to the production Environment. Execution is on OLP. For an example implementation, see the Example Deployment Implementation.
In the above steps, the successful completion of a step triggers the next step. You can add more than one job in step 2 or step 3 to test multiple pipelines in parallel or to deploy multiple pipelines to production.
The sections below provide additional details on what is required to set up this CI/CD workflow.