summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-02-23 00:31:55 +0200
committerytti <saku@ytti.fi>2016-02-23 00:31:55 +0200
commit1d6be9c011a9195626f59d3d62ac2febe9dd3149 (patch)
tree01eb7f3d336aaeb90347510afb32715bd7c042bc /README.md
parent2543d95d150844eb6e619f6c99dd26fc9b1d1084 (diff)
parent69210c7ddf7d77cc9eb7b78f0bc00ad2f1475955 (diff)
Merge pull request #326 from danilopopeye/group-remotes-and-hooks
multiple remotes for groups in GithubRepo hook
Diffstat (limited to 'README.md')
-rw-r--r--README.md61
1 files changed, 61 insertions, 0 deletions
diff --git a/README.md b/README.md
index 4e5c180..5158ed5 100644
--- a/README.md
+++ b/README.md
@@ -375,13 +375,40 @@ output:
This uses the rugged/libgit2 interface. So you should remember that normal Git hooks will not be executed.
+
+For a single repositories for all devices:
+
+``` yaml
+output:
+ default: git
+ git:
+ user: Oxidized
+ email: o@example.com
+ repo: "/var/lib/oxidized/devices.git"
```
+
+And for groups repositories:
+
+``` yaml
output:
default: git
git:
user: Oxidized
email: o@example.com
+ repo:
+ first: "/var/lib/oxidized/first.git"
+ second: "/var/lib/oxidized/second.git"
+```
+
+If you would like to use groups and a single repository, you can force this with the `single_repo` config.
+
+``` yaml
+output:
+ default: git
+ git:
+ single_repo: true
repo: "/var/lib/oxidized/devices.git"
+
```
### Output: Http
@@ -559,6 +586,40 @@ hooks:
timeout: 120
```
+### githubrepo
+
+This hook configures the repository `remote` and _push_ the code when the specified event is triggerd. If the `username` and `password` are not provided, the `Rugged::Credentials::SshKeyFromAgent` will be used.
+
+`githubrepo` hook recognizes following configuration keys:
+
+ * `remote_repo`: the remote repository to be pushed to.
+ * `username`: username for repository auth.
+ * `password`: password for repository auth.
+
+When using groups repositories, each group must have its own `remote` in the `remote_repo` config.
+
+``` yaml
+hooks:
+ push_to_remote:
+ remote_repo:
+ routers: git@git.intranet:oxidized/routers.git
+ switches: git@git.intranet:oxidized/switches.git
+ firewalls: git@git.intranet:oxidized/firewalls.git
+```
+
+
+## Hook configuration example
+
+``` yaml
+hooks:
+ push_to_remote:
+ type: githubrepo
+ events: [node_success, post_store]
+ remote_repo: git@git.intranet:oxidized/test.git
+ username: user
+ password: pass
+```
+
# Ruby API
The following objects exist in Oxidized.