summaryrefslogtreecommitdiff
path: root/baserock_webserver/gitlab-bot
diff options
context:
space:
mode:
Diffstat (limited to 'baserock_webserver/gitlab-bot')
-rw-r--r--baserock_webserver/gitlab-bot/config.js66
-rw-r--r--baserock_webserver/gitlab-bot/gitlab-bst-bot.conf19
-rw-r--r--baserock_webserver/gitlab-bot/gitlab-bst-bot.service.in12
-rw-r--r--baserock_webserver/gitlab-bot/gitlab_buildstream_secret.yml8
4 files changed, 105 insertions, 0 deletions
diff --git a/baserock_webserver/gitlab-bot/config.js b/baserock_webserver/gitlab-bot/config.js
new file mode 100644
index 00000000..13b66e13
--- /dev/null
+++ b/baserock_webserver/gitlab-bot/config.js
@@ -0,0 +1,66 @@
+module.exports = {
+ // IRC server to connect to.
+ servers: {
+ gimp: 'irc.gimp.org',
+ freenode: 'irc.freenode.net'
+ },
+
+ // List of channels / people to report to.
+ triggers: [
+ {
+ project: 'baserock/definitions',
+ network: 'freenode',
+ reports: {
+ '#baserock': ['merge_request', 'issue']
+ }
+ },
+ {
+ project: 'baserock/infrastructure',
+ network: 'freenode',
+ reports: {
+ '#baserock': ['merge_request', 'issue']
+ }
+ },
+ {
+ project: 'baserock/lorries',
+ network: 'freenode',
+ reports: {
+ '#baserock': ['merge_request', 'issue']
+ }
+ },
+ {
+ project: 'baserock/ybd',
+ network: 'freenode',
+ reports: {
+ '#baserock': ['merge_request', 'issue']
+ }
+ },
+ {
+ project: 'BuildStream/buildstream',
+ network: 'gimp',
+ reports: {
+ '#buildstream': ['push', 'merge_request', 'issue']
+ }
+ },
+ ],
+
+ // IRC nick/names for the bot
+ nick: 'gitlab-br-bot',
+ userName: 'gitlab-br-bot',
+ realName: 'Gitlab Bot provided by Baserock',
+
+ // Secret as entered in the Gitlab Webhook instance.
+ secret: '{{ gitlab_buildstream_secret }}',
+
+ // Port on which to run.
+ port: 1337,
+
+ // Network interface on which to run the webhook server.
+ hostname: '0.0.0.0',
+
+ // Instance of lstu to shorten links -- keep empty to not use.
+ //lstu: 'https://lstu.fr',
+
+ // Whether the irc client debug messages should be printed.
+ debug: true
+}
diff --git a/baserock_webserver/gitlab-bot/gitlab-bst-bot.conf b/baserock_webserver/gitlab-bot/gitlab-bst-bot.conf
new file mode 100644
index 00000000..b34026a8
--- /dev/null
+++ b/baserock_webserver/gitlab-bot/gitlab-bst-bot.conf
@@ -0,0 +1,19 @@
+# /etc/init/gitlab-bst-bot.conf
+
+description "Gitlab irc notifications server"
+
+start on startup
+stop on shutdown
+
+
+# Automatically Respawn:
+respawn
+respawn limit 99 5
+
+setuid ubuntu
+setgid ubuntu
+
+script
+ cd {{ gitlab_to_irc_install_location }}
+ exec sudo node index.js
+end script
diff --git a/baserock_webserver/gitlab-bot/gitlab-bst-bot.service.in b/baserock_webserver/gitlab-bot/gitlab-bst-bot.service.in
new file mode 100644
index 00000000..cc3f5af4
--- /dev/null
+++ b/baserock_webserver/gitlab-bot/gitlab-bst-bot.service.in
@@ -0,0 +1,12 @@
+[Unit]
+Description = Gitlab irc notifications server
+
+[Service]
+Type = simple
+ExecStart = /usr/bin/node {{ gitlab_to_irc_install_location }}/index.js
+User = fedora
+Group = fedora
+Restart = on-failure
+
+[Install]
+WantedBy=default.target
diff --git a/baserock_webserver/gitlab-bot/gitlab_buildstream_secret.yml b/baserock_webserver/gitlab-bot/gitlab_buildstream_secret.yml
new file mode 100644
index 00000000..53ae22e0
--- /dev/null
+++ b/baserock_webserver/gitlab-bot/gitlab_buildstream_secret.yml
@@ -0,0 +1,8 @@
+$ANSIBLE_VAULT;1.1;AES256
+35376536656664653761336331643738343738643365623832626464313335383439623761313434
+3634373330363634666566353766373862643266373431380a396566356261653937343131666338
+36356133636465323135643264306461386437613064636164656361656264616239333236353430
+3734343639313337620a396431356335376638316339646362633436613065646366326134363032
+61613132383832346637396666373761363230666234303530646533336363653139643264623862
+39616663643138623538383336323538313963396463653563643134326664643930303135383039
+623636663031333934633261663436303735