You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Bot could be run within your infrastructure as container.
21
37
In case you want to test the bot you can use gitlab cloud bot.
22
38
23
-
### Self-hosted
39
+
40
+
### Gitlab Cloud
41
+
1. Invite bot ([@mergeapprovebot](https://gitlab.com/mergeapprovebot)) in your repository as **maintainer** (you can revoke permissions from usual developers in order to prevent merging)
42
+
2. Add webhook `https://mergebot.tools/mergebot/webhook/gitlab/your_username_or_company_name/repo-name/` (Comments and merge request events)
43
+
3. PROFIT: now you can create MR, leave commands: !check and then !merge (comment in MR)
44
+
45
+
You can test bot on gitlab public repo: https://gitlab.com/Gasoid/sugar-test
46
+
47
+
### Docker-compose
24
48
25
49
1. bot.env:
26
50
```
27
51
GITLAB_TOKEN="your_token"
28
52
#TLS_ENABLED="false"
29
53
#TLS_DOMAIN="domain.your-example.com"
54
+
#GITLAB_URL=""
30
55
```
31
56
32
57
2. run docker-compose
33
58
```
34
59
docker-compose up -d
35
60
```
36
61
62
+
63
+
### Helm
64
+
65
+
[Helm](https://helm.sh) must be installed to use the charts. Please refer to
66
+
Helm's [documentation](https://helm.sh/docs) to get started.
67
+
68
+
Once Helm has been set up correctly, add the repo as follows:
If you had already added this repo earlier, run `helm repo update` to retrieve
73
+
the latest versions of the packages. You can then run `helm search repo merge-bot` to see the charts.
74
+
75
+
To install the merge-bot chart:
76
+
77
+
helm install my-merge-bot merge-bot/merge-bot
78
+
79
+
To uninstall the chart:
80
+
81
+
helm uninstall my-merge-bot
82
+
83
+
### CLI
84
+
85
+
Create personal/repo/org token in gitlab, copy it and set as env variable
86
+
```bash
87
+
export GITLAB_TOKEN="your_token"
88
+
export GITLAB_URL=""# if it is not public gitlab cloud
89
+
export TLS_ENABLED="true"
90
+
export TLS_DOMAIN="bot.domain.com"
91
+
```
92
+
37
93
you can configure bot using cli args as well:
38
94
```bash
39
95
Usage of merge-bot:
@@ -49,32 +105,11 @@ Usage of merge-bot:
49
105
whether tls enabled or not, bot will use Letsencrypt, default is false (also via TLS_ENABLED)
50
106
```
51
107
52
-
### Setup for Gitlab Cloud
53
-
1. Invite bot ([@mergeapprovebot](https://gitlab.com/mergeapprovebot)) in your repository as **maintainer** (you can revoke permissions from usual developers in order to prevent merging)
54
-
2. Add webhook `https://mergebot.tools/mergebot/webhook/gitlab/your_username_or_company_name/repo-name/` (Comments and merge request events)
55
-
3. PROFIT: now you can create MR, leave commands: !check and then!merge (comment in MR)
56
-
57
-
### Quickstart on your env
58
-
59
-
Create personal/repo/org token in gitlab, copy it and set as env variable
60
-
```bash
61
-
export GITLAB_TOKEN="your_token"
62
-
export GITLAB_URL=""# if it is not public gitlab cloud
63
-
export TLS_ENABLED="true"
64
-
export TLS_DOMAIN="bot.domain.com"
65
-
```
66
-
67
108
Run bot
68
109
```
69
110
go run ./
70
111
```
71
112
72
-
### Build
73
-
```
74
-
go build ./
75
-
```
76
-
77
-
78
113
79
114
## Config file
80
115
@@ -102,7 +137,7 @@ stale_branches_deletion:
102
137
days: 90 # branch is staled after int days, default is 90
103
138
```
104
139
105
-
Example:
140
+
#### Example:
106
141
107
142
```yaml
108
143
approvers:
@@ -123,3 +158,7 @@ stale_branches_deletion:
123
158
```
124
159
125
160
place it in root of your repo and name it `.mrbot.yaml`
161
+
162
+
### Required bot permissions
163
+
- Bot must have __Maintainer__ role in order to comment, merge and delete branches
164
+
- Access Token must have following permissions: api, read_repository, write_repository
0 commit comments