nwaku/docs/contributors/continuous-integration.md
Jakub Sokołowski 086cb81a81 ci: add MAKE_TARGET parameter, remove default from IMAGE_TAG
Adjustments to Jenkinsfile to allow building of different targets and
pushing images with different tags depending on job parameters.

If we specify a `string` parameter in `parameters` they will be
overwritten in job definition after very job build.

I created four jobs at: https://ci.status.im/job/nim-waku/

* [manual](https://ci.status.im/job/nim-waku/job/manual/) - For building by hand
* [deploy-v1-test](https://ci.status.im/job/nim-waku/job/deploy-v1-test/) - Auto build from `master`
* [deploy-v2-test](https://ci.status.im/job/nim-waku/job/deploy-v2-test/) - Auto build from `master`
* [deploy-v2-prod](https://ci.status.im/job/nim-waku/job/deploy-v2-prod/) - Triggered manually

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2020-12-04 11:18:31 +01:00

33 lines
1.4 KiB
Markdown

# Description
This document describes the continuous integration setup for `nim-waku`.
# Details
The CI setup exists on the Status.im Jenkins instance:
https://ci.status.im/job/nim-waku/
It currently consists four jobs:
* [manual](https://ci.status.im/job/nim-waku/job/manual/) - For manually executing builds using parameters.
* [deploy-v1-test](https://ci.status.im/job/nim-waku/job/deploy-v1-test/) - Builds every new commit in `master` and deploys to `wakuv1.test` fleet.
* [deploy-v2-test](https://ci.status.im/job/nim-waku/job/deploy-v2-test/) - Builds every new commit in `master` and deploys to `wakuv2.test` fleet.
* [deploy-v2-prod](https://ci.status.im/job/nim-waku/job/deploy-v2-prod/) - Currently has no automatic trigger, and deploys to `wakuv2.prod` fleet.
# Configuration
The main configuration file is [`Jenkinsfile`](../../Jenkinsfile) at the root of this repo.
Key part is the definition of four `parameters`:
* `MAKE_TARGET` - Which `Makefile` target is built.
* `IMAGE_TAG` - Tag of the Docker image to push.
* `IMAGE_NAME` - Name of the Docker image to push.
* `NIM_PARAMS` - Nim compilation parameters.
The use of `?:` [Elvis operator](http://groovy-lang.org/operators.html#_elvis_operator) plays a key role in allowing parameters to be changed for each defined job in Jenkins without it being overridden by the `Jenkinsfile` defaults after every job run.
```groovy
defaultValue: params.IMAGE_TAG ?: 'deploy-v2-test',
```