From f8615e1a8c6d9410dfc782e4b5b522184e6765cd Mon Sep 17 00:00:00 2001 From: Brice Schaffner Date: Mon, 24 Jun 2024 15:56:19 +0200 Subject: [PATCH] Added CI readme --- CI.md | 40 ++++++++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 41 insertions(+) create mode 100644 CI.md diff --git a/CI.md b/CI.md new file mode 100644 index 0000000..e68de54 --- /dev/null +++ b/CI.md @@ -0,0 +1,40 @@ +# Continuous Integration + +Each service or productive piece of software should be automatically tested, before merged to `develop`. We use [AWS CodeBuild](https://docs.aws.amazon.com/fr_fr/codebuild/) for building/testing code. For every software we have two Codebuild projects + +- One which is triggered by Pull Request CREATE and UPDATE event + - This one lint, check formatting, build and test the code +- One which is triggered by Pull Request merge event + - This one build and release the build artefact (release on S3 build artifact or ECR repository) + +## Table of contents + +- [Table of contents](#table-of-contents) +- [Guidelines](#guidelines) +- [Build Badge](#build-badge) + +## Guidelines + +- Each Codebuild project is managed via terraform in a dedicated repository +- `buildspec.yml` file is located within the terraform module of the Codebuild project which is in a private repository. This ensure security where a non authorized person cannot see and edit the buildspec and trigger a build on a public repository. +- Don't use secrets/password inside the buildspec but use AWS SSM [AWS System Manager (SSM)](https://docs.aws.amazon.com/systems-manager/index.html) +- Use build badge in the software github repository see [Build Badge](#build-badge) + +## Build Badge + +Build badge should be added to the top of the README.md file of the github project using the following template: + +```md +| Branch | Status | +|--------|-----------| +| develop | ![Build Status](BADGE_LINK) | +| master | ![Build Status](BADGE_LINK) | +``` + +To get the badge login to the [AWS Console](https://console.aws.amazon.com) on the account managing Codebuild and navigate to the Codebuild project (make sure you are on the correct AWS zone `eu-central-1`). Then on the project main page click on `Copy badge URL`. This link looks as follow: + +```bash +https://codebuild.eu-central-1.amazonaws.com/badges?uuid=eyJl...I6MX0%3D&branch=master +``` + +Change the branch at the end of the link accordingly. diff --git a/README.md b/README.md index 1cc01d2..5a5acef 100644 --- a/README.md +++ b/README.md @@ -19,3 +19,4 @@ Geoadmin PP BGDI general and coding guidelines. 3. [Git Flow](GIT_FLOW.md) 4. [Github Workflows](GITHUB_WORKFLOW.md) 3. [Versioning and release](VERSIONING_RELEASE.md) +4. [CI](CI.md)