poly
Search…
Continuous Integration
How this repository sets up its own continuous integration and deployment is described here. In this document we will look at the general setup of CI.
When setting up continuous integration, we sometimes want to keep track of changes per project. To support this we need to add tag patterns for the projects we want to build, e.g.:
1
:tag-patterns {:stable "stable-*"
2
:release "v[0-9]*"
3
:myproject "myproject-*"}
Copied!
When our build is triggered, e.g. via a webhook, we can ask the poly tool what projects have changed since the last successful build:
1
poly ws get:changes:changed-or-affected-projects since:myproject
Copied!
output, e.g.:
1
["invoicer" "myproject"]
Copied!
If myproject is returned, which is the case here, then we know that this project needs to be built and deployed, as long as all tests also pass. After a successful build, we tag the repository, e.g.:
1
git tag myproject-1
Copied!
We want to keep the release tags, which is the reason each tag gets its own unique tag name, e.g. myproject-1, myproject-2, and so on. It's not important that the IDs are sequential. The tool will always sort them by the order they exist in git anyway.
If the CI build is set up so that it builds all projects in one go, then we could first start by asking what projects we have:
1
poly ws get:projects:keys skip:dev
Copied!
The skip:dev parameter tells the tool to ignore the development environment (we are not interested in deploying dev). More than one project can be ignored, e.g. skip:dev:invoicer, where both project names and aliases can be used.
Then we can ask for changed or affected projects:
1
poly ws get:changes:changed-or-affected-projects since:release skip:dev
Copied!
Here we rely on release-* tags that mark the whole repo as released.
Last modified 2mo ago
Copy link