CI Pipeline example
This is an example of how to build a CI pipeline with Orbits.
This example is a live example: this app is currently managing the Github repository “LaWebcapsule/Orbits”.
Scope
This example manages CI/CD workflows for the github repository “LaWebcapsule/Orbits”.
It demonstrates how we think we should use Orbits for DevOps workflow:
- an entire Node.js package which only DevOps functions, actions.
You can change some variables to use it for your own repository.
Here is the state of the current implementation of the pipeline:
- :heavy_check_mark: publish npm packages on each commit on the master branch
- :construction_worker: test all PR before merging
Architecture
- ./src/actions/ contains the Actions like publishing an npm package, updating package.json…
- ./src/workflows/ contains the Workflow for the different git branches behavior.
- ./src/main-workflow/ will contains our main workflow
- ./index.ts contains the bootstrapping process
Installation
Requirements
See the requirements for Orbits installation
Secrets are currently passed through environment variables.
This package need four environment variables: git_user
, git_pwd
, gh_token
, NPM_TOKEN
Customizing the app
Once this folder downloaded on your machine and the requirements installed, you can:
- modify the bootstrapping process with your mongodb url
- modify the git repository (current: LaWebcapsule/orbits)
- add or remove different steps of the process.
- e.g., you can integrate a pipeline with a CDK deployment (see the cdk example)
Launching the app
- install the dependencies
- build the app
- launch the app
You can also use ts-node:
With docker compose
- Copy the docker-compose file at the root of this git project.
cp ./../../../docker-compose.yml ./docker-compose.yml
- Launch the app with docker-compose