Browse Source

Hook up the auto-add config for gitea.

[Pun very much intended]
master
Chris Smith 5 years ago
parent
commit
777ca2c739
2 changed files with 8 additions and 3 deletions
  1. 3
    2
      README.md
  2. 5
    1
      lineandsinker/services/__init__.py

+ 3
- 2
README.md View File

@@ -40,9 +40,10 @@ Environment variable | Description
40 40
 -------------------- | --------------------------------------------------------
41 41
  `LAS_GITEA_URL`     | Base URL of the Gitea instance to connect to
42 42
  `LAS_GITEA_TOKEN`   | Application token to use to authenticate to Gitea
43
+ `LAS_GITEA_ADD_HOOKS` | If present, automatically add hooks to all repos
43 44
 
44
-LaS automatically adds itself as a hook for all repositories it has access to
45
-using the given token.
45
+LaS accepts Gitea webhooks and can automatically add itself as a hook
46
+for all repositories it has access to using the given token.
46 47
 
47 48
 ### Jenkins
48 49
 

+ 5
- 1
lineandsinker/services/__init__.py View File

@@ -12,7 +12,11 @@ def docker_factory():
12 12
 
13 13
 
14 14
 def gitea_factory():
15
-    return Gitea(os.environ["LAS_GITEA_URL"], os.environ["LAS_GITEA_TOKEN"])
15
+    return Gitea(
16
+        os.environ["LAS_GITEA_URL"],
17
+        os.environ["LAS_GITEA_TOKEN"],
18
+        install_hooks="LAS_GITEA_ADD_HOOKS" in os.environ,
19
+    )
16 20
 
17 21
 
18 22
 def jenkins_factory():

Loading…
Cancel
Save