Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/max-lt/github-hook

Server that execute CI script when called from Github.
https://github.com/max-lt/github-hook

continuous-deployment continuous-integration github github-api

Last synced: 24 days ago
JSON representation

Server that execute CI script when called from Github.

Awesome Lists containing this project

README

        

# Github hook server

This repository will be archived as it has been rewritten is rust! [Check it out](https://github.com/max-lt/github-hook-rs)

## Install

Copy / fork source somewhere (for example in `/opt/github-hook`).

Create '/etc/systemd/system/github-hook.service'
```
[Unit]
Description=Github Webhook Server
After=network.target

[Service]
ExecStart=/usr/bin/node /opt/github-hook/src/index.js
# Required on some systems
#WorkingDirectory=/opt/nodeserver
Restart=always
# Restart service after 10 seconds if node service crashes
RestartSec=10
# Output to syslog
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=github-hook
#User=
#Group=
Environment=NODE_ENV=production PORT=8080 CONFIG=/home/me/my-config.yml

[Install]
WantedBy=multi-user.target
```

## Start
```
systemctl start github-hook
```

## Example of config file

```yml
repositories:
project1:
secret: project1secret
script: /some/path/script.sh
project2:
secret: project2secret
script: /another/path/script.sh --some-argument
project3:
secret: project1secret
script: /some/path/script.sh
branch: master # optional
```

# Configure your github project:

> Note that this is an example for the "project1" repository.

Go into your project's settings > webhooks

Set `Payload URL` to `http://example.com:8080/github-hook/project1`

Set `Content type` to `application/json`

Set `Secret` to `project1secret`