# sli-reporter

SLI Reporter for dbaas

## CI/CD

Once a change is merged to the master branch, an image will be built and pushed to the dev registry, whose image tag is git hash. 

Then several PRs will be created automatically to bump the image tag in these repos:
- [`infra-cd`](https://github.com/tidbcloud/infra-cd), manage sli-reporter in `shoot` cluster, e.g. [infra-cd#475](https://github.com/tidbcloud/infra-cd/pull/475)
- [`metrics-server`](https://github.com/tidbcloud/metrics-server), manage sli-reporter in `base` cluster, e.g. [metrics-server#5](https://github.com/tidbcloud/metrics-server/pull/5)
- [`aws-shared-cd`](https://github.com/tidbcloud/aws-shared-cd), manage sli-reporter in `dev-tier` cluster, e.g. [aws-shared-cd#658](https://github.com/tidbcloud/aws-shared-cd/pull/658).

Make sure the automated PRs are merged and the new image will be deployed to **dev**.

## How to release

Use the following commands to trigger the Jenkins pipeline, and the image will be tagged with the `v<X.Y.Z>` (like `v0.1.0`).

```bash
# Make the local branch up to date
git checkout master
git pull origin master

# Change the version number
# Name rule of tag: release-v*
git tag release-v0.1.0
git push --tags
```

**Note: To confirm that the image has already been pushed to the prod registry, you can visit Github Action like [Release Workflow](https://github.com/tidbcloud/sli-reporter/runs/8066662652?check_suite_focus=true), click the release job details and check the log.**

After pushing the tag, it will trigger automated PRs to bump the image tag in these repos:
- [`infra-cd`](https://github.com/tidbcloud/infra-cd), manage sli-reporter in `shoot` cluster, e.g. [infra-cd#474](https://github.com/tidbcloud/infra-cd/pull/474)
- [`metrics-server`](https://github.com/tidbcloud/metrics-server), manage sli-reporter in `base` cluster, **remember to connect the manager of `metrics-server` to release a new version**, e.g. [metrics-server#6](https://github.com/tidbcloud/metrics-server/pull/6)
- [`aws-shared-cd`](https://github.com/tidbcloud/aws-shared-cd), manage sli-reporter in `dev-tier` cluster, e.g. [aws-shared-cd#661](https://github.com/tidbcloud/aws-shared-cd/pull/661).

Approve it and merge. The new image will be deployed to **staging and prod**.
