Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gnailuy/githook
Github Hook Service for gnailuy.com
https://github.com/gnailuy/githook
Last synced: 3 months ago
JSON representation
Github Hook Service for gnailuy.com
- Host: GitHub
- URL: https://github.com/gnailuy/githook
- Owner: gnailuy
- Created: 2014-08-28T21:55:23.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2024-04-23T14:44:13.000Z (7 months ago)
- Last Synced: 2024-07-16T14:10:57.555Z (4 months ago)
- Language: Ruby
- Size: 38.1 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
githook
=======Github Hook Service for [gnailuy.com](http://gnailuy.com/).
### Prepare the site directory
``` bash
WORKDIR=/home/yourusername/mkdir -p $WORKDIR/webroot
mkdir -p $WORKDIR/redis_data
mkdir -p $WORKDIR/logsgit clone https://github.com/gnailuy/gnailuy.com.git
cd $WORKDIR/gnailuy.com
git submodule init
git submodule update# Copy `environment.rc` to $WORKDIR and edit it according to your configuration
```### Build the image
``` bash
# Build `gnailuy/jekyll` first. See: http://github.com/gnailuy/gnailuy.com/# In the `server` directory
docker build -t gnailuy/githook_server .# In the `worker` directory
docker build -t gnailuy/githook_worker .
```### Run on Docker
``` bash
WORKDIR=/home/yourusername/# Create network (run once)
docker network create githook# Run redis
docker run -d --restart unless-stopped --network githook --name redis -v ${WORKDIR}/githook/redis/redis.conf:/etc/redis/redis.conf -v ${WORKDIR}/redis_data:/data -t redis redis-server /etc/redis/redis.conf# Run the worker
docker run -d --restart unless-stopped --network githook --name githook_worker -v ${WORKDIR}/gnailuy.com/:/app/gnailuy.com/ -v ${WORKDIR}/webroot:/app/webroot/ -v ${WORKDIR}/logs:/app/logs/ -t gnailuy/githook_worker# Run the server
docker run -d --restart unless-stopped --network githook --name githook_server --env-file ./environment.rc -v ${WORKDIR}/logs:/app/logs/ -p 20182:20182 -t gnailuy/githook_server
```Note for myself: I put the nginx server to the same network `githook` and use the nginx server to proxy the webhook requests now.
It's not necessary to bind the `githook_server` port to the host and I've closed the port in the firewall.### Connect to redis
``` bash
docker run -it --network githook --rm redis redis-cli -h redis
```