Skip to content

Commit

Permalink
Update Go version and base image in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
flexoid committed Jul 26, 2024
1 parent 622d3bd commit bfddea0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20 as builder
FROM golang:1.22-bookworm AS builder

WORKDIR /app

Expand All @@ -8,7 +8,7 @@ RUN go mod download
COPY . .
RUN go build -o mergentle-reminder

FROM gcr.io/distroless/base-debian11
FROM gcr.io/distroless/base-debian12

COPY --from=builder /app/mergentle-reminder /mergentle-reminder

Expand Down
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ The name "Mergentle Reminder" is a playful combination of the words "merge" and

## Configuration

You can configure the Mergentle Reminder bot using a `config.yaml` file or by setting the environment variables.
You can configure the Mergentle Reminder bot using a `config.yaml` file or by setting the environment variables.

Example config can be found in `config.yaml.example`.

In addition to the config.yaml file, the following environment variables can be set:

* `GITLAB_URL`: The URL of your GitLab instance (defaults to https://gitlab.com).
* `GITLAB_TOKEN`: Your GitLab personal access token.
* `SLACK_WEBHOOK_URL`: The webhook URL for the Slack channel where the bot will send messages.
* `PROJECTS`: A comma-separated list of GitLab project IDs to check for merge requests.
* `GROUPS`: A comma-separated list of GitLab group IDs to check for merge requests.
* `CONFIG_PATH` (optional): The path to the config.yaml configuration file. Defaults to config.yaml.
- `GITLAB_URL`: The URL of your GitLab instance (defaults to https://gitlab.com).
- `GITLAB_TOKEN`: Your GitLab personal access token.
- `SLACK_WEBHOOK_URL`: The webhook URL for the Slack channel where the bot will send messages.
- `PROJECTS`: A comma-separated list of GitLab project IDs to check for merge requests.
- `GROUPS`: A comma-separated list of GitLab group IDs to check for merge requests.
- `CONFIG_PATH` (optional): The path to the config.yaml configuration file. Defaults to config.yaml.

Environment variables take precedence over the config.yaml file.

Expand Down Expand Up @@ -69,6 +69,7 @@ docker run -e GITLAB_TOKEN=<your_gitlab_token> -e SLACK_WEBHOOK_URL=<your_slack_
```

### Deploying to Kubernetes

Create a configmap for the config.yaml file:

```sh
Expand All @@ -91,3 +92,10 @@ kubectl apply -f k8s/
```

The application will now run as a CronJob in your Kubernetes cluster, periodically sending reminders to the configured Slack channel.

It is possible to create a new job manually for testing purposes:

```sh
kubectl -n mergentle-reminder create job --from=cronjob/mergentle-reminder test-job
kubectl -n mergentle-reminder delete jobs/test-job
```

0 comments on commit bfddea0

Please sign in to comment.