Skip to content

Commit

Permalink
Added CI readme
Browse files Browse the repository at this point in the history
  • Loading branch information
ltshb committed Jun 25, 2024
1 parent 67b467c commit f8615e1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
40 changes: 40 additions & 0 deletions CI.md
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit f8615e1

Please sign in to comment.