Setting up repository
The way a repository is set up is hugely dependent on the type of the repository (library or application)
Setting up a Library Project Repository
Expectation of the CI system (Build)
- A master build is triggered when a pull request to master branch is completed. The master build publishes the library artifact.
- A Repository Dispatch is triggered when the a build is triggered through the tool. The build publishes the library artifact.
- A PR build should be mergable only when the below conditions are met
- When the PR build runs successfully (versioning rule and unit tests are met)
- When the PR is review at least by one developer
- The PR branch is based on the lastest version of master
- The master branch should support linear version history
Setting up of a library Project
- Create a empty repository
- Add version file (version.txt) to the repository. The content of the file has to be “."
- Add app-type file (app-type.txt) to the repository. The content of the file has to be “lib”
- Add scripts files to the repository
- scripts-build.sh - This script will be called by workflows to build the project.
- scripts-test.sh - This script will be called by the workflows to unit test the project.
- scripts-package.sh - This script will be called by the workflows to publish the project artifacts.
- Add Master Build workflow. How to add a work flow can be found here
- Add PR build workflow
- Add Repository dispatch workflow
- Create a dummy branch and a dummy pull request. This is done to so that the system searches for the workflows.
- Create a branch protection rule for “master” branch as detailed here
- There is a bit of tradeoff in consuming maven packages. More information is available here
### Examples
- This example produces a maven package.
- This example produces a maven package and also consumes another maven package
Setting up a Application Project Repository
Expectation of the CI system (Build)
- A master build is triggered when a pull request to master/rel-* branch is completed. The master build publishes the artifact.
- A Repository Dispatch is triggered when the a build is triggered through the tool. The build publishes the artifact.
- A PR to master/rel-* should be mergable only when the below conditions are met
- When the PR build runs successfully (versioning rule and unit tests are met)
- When the PR is review at least by one developer
- The PR branch is based on the lastest version of master
- The master branch should support linear version history
Setting up of a Application Project
- Create a empty repository
- Add version file (version.txt) to the repository. The content of the file has to be “."
- Add app-type file (app-type.txt) to the repository. The content of the file has to be “app”
- Add scripts files to the repository
- scripts-build.sh - This script will be called by workflows to build the project.
- scripts-test.sh - This script will be called by the workflows to unit test the project.
- scripts-package.sh - This script will be called by the workflows to publish the project artifacts.
- Add Master Build workflow. How to add a work flow can be found here
- Add PR build workflow
- Add Repository dispatch workflow
- Create a dummy branch and a dummy pull request. This is done to so that the system searches for the workflows.
- Create a branch protection rule for “master” and “rel-*” branches as detailed here
- There is a bit of tradeoff in consuming maven packages. More information is available here
### Examples