2021-05-24 20:53:22 +02:00
# Contribution Guidelines
## Table of Contents
- [Contribution Guidelines ](#contribution-guidelines )
2021-10-03 17:49:23 +02:00
- [Table of Contents ](#table-of-contents )
- [Setup development environment ](#setup-development-environment )
2021-10-17 10:07:39 +02:00
- [Build and Run ](#build-and-run )
2021-10-03 17:49:23 +02:00
- [Testing ](#testing )
2022-05-14 01:10:07 +02:00
- [Helm Chart ](#helm-chart )
2021-10-11 08:52:35 +02:00
- [Release ](#release )
2021-10-03 17:49:23 +02:00
- [Developer Certificate of Origin (DCO) ](#developer-certificate-of-origin-dco )
2021-05-24 20:53:22 +02:00
2021-06-06 13:41:14 +02:00
## Setup development environment
```bash
# Build docker environment
docker build -t gitea-sonarqube-pr-bot/dev -f contrib/Dockerfile contrib
2021-06-20 15:16:06 +02:00
# Start the environment
2021-10-09 21:17:54 +02:00
docker run --rm -it -p 49182:3000 -v "$(pwd):/projects" gitea-sonarqube-pr-bot/dev
2021-10-17 10:07:39 +02:00
```
2021-06-06 13:41:14 +02:00
2021-10-17 10:07:39 +02:00
## Build and Run
2021-06-20 15:16:06 +02:00
2021-10-17 10:07:39 +02:00
```bash
# Build the binary
make build
2021-06-06 13:41:14 +02:00
# Start the server
2021-10-17 10:07:39 +02:00
make run
# or all in once
make build run
2021-06-20 15:16:06 +02:00
```
## Testing
```bash
2021-10-17 10:07:39 +02:00
make test
# or
make coverage
2021-06-06 13:41:14 +02:00
```
2021-05-24 20:53:22 +02:00
2022-05-14 01:10:07 +02:00
## Helm Chart
The [Parameters section ](helm/README.md#parameters ) is auto-generated using [readme-generator-for-helm ](https://github.com/bitnami-labs/readme-generator-for-helm ).
When modifying anything in the `helm` directory, remember to update the documentation by running
```bash
make helm-params
```
2021-10-11 08:52:35 +02:00
## Release
For local purposes
```bash
docker build -t gitea-sonarqube-pr-bot/prod .
```
2022-05-14 01:10:07 +02:00
**Docker image**
2022-05-13 20:48:47 +02:00
```bash
docker build -t justusbunsi/gitea-sonarqube-bot:$TAG .
docker push justusbunsi/gitea-sonarqube-bot:$TAG
```
2022-05-14 01:10:07 +02:00
**Helm Chart**
```bash
make helm-pack
```
Use the two files in `helm-releases` and push them to the `charts` branch.
2021-05-24 20:53:22 +02:00
## Developer Certificate of Origin (DCO)
I consider the act of contributing to the code by submitting a Pull Request as the "Sign off" or agreement to the
certifications and terms of the [DCO ](DCO ) and [MIT license ](LICENSE ). No further action is required. Additionally,
you could add a line at the end of your commit message.
```
Signed-off-by: Joe Smith < joe.smith @ email . com >
```
If you set your `user.name` and `user.email` git configs, you can add the line to the end of your commit automatically
with `git commit -s` .
I assume in good faith that the information you provide is legally binding.