updated and added init script
This commit is contained in:
1 parent
5721a871bd
commit
bd3d9e1856
17 files changed
+55
-37
No files matched your search
@@ -1,23 +0,0 @@
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
docker:
|
||||
- image: golang:1.6.4
|
||||
steps:
|
||||
- setup_remote_docker
|
||||
- checkout
|
||||
- run:
|
||||
name: Install Docker client
|
||||
command: |
|
||||
set -x
|
||||
VER="17.03.0-ce"
|
||||
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
|
||||
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
|
||||
mv /tmp/docker/* /usr/bin
|
||||
|
||||
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
|
||||
- run: docker build -t chaospott/site .
|
||||
- run: |
|
||||
docker tag chaospott/site chaospott/site:$CIRCLE_SHA1
|
||||
docker push chaospott/site:$CIRCLE_SHA1
|
||||
docker push chaospott/site:latest
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,12 @@
|
||||
[
|
||||
{
|
||||
"id": "$ENDPOINT_ID",
|
||||
"execute-command": "/webhook/reload.sh",
|
||||
"command-working-directory": "/repo",
|
||||
"match":
|
||||
{
|
||||
"secret": "$ENDPOINT_PW"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
+15
-14
@@ -2,36 +2,37 @@ version: '3.3'
|
||||
|
||||
services:
|
||||
webhook:
|
||||
image: cryptkiddie2/webhook:latest
|
||||
image: cryptkiddie2/webhook-docker:latest
|
||||
restart: always
|
||||
labels:
|
||||
- "traefik.frontend.rule=Host:site.webhook.nachtigall.chaospott.de"
|
||||
- "traefik.port=9000"
|
||||
- "traefik.docker.network=web"
|
||||
- traefik.frontend.rule=Host:site.webhook.nachtigall.chaospott.de
|
||||
- traefik.port=9000
|
||||
- traefik.docker.network=web
|
||||
networks:
|
||||
- extern
|
||||
expose:
|
||||
- 80
|
||||
- 9000
|
||||
volumes:
|
||||
- /data/rasen-nein-danke.de/webhook/:/webhook
|
||||
- /data/beta.chaospott.de/repo/:/repo
|
||||
- ${DATA_ROOT}/webhook/:/webhook
|
||||
- ${DATA_ROOT}/repo/:/repo
|
||||
command: [-hooks, /webhook/hooks.json, -verbose]
|
||||
jekyll:
|
||||
image: jekyll/jekyll
|
||||
restart: always
|
||||
command: ["/usr/jekyll/bin/jekyll", "build", "--source", "/repo/web", "--destination", "/static", "--watch"]
|
||||
command: [/usr/jekyll/bin/jekyll, build, --source, /repo/web, --destination, /static, --watch]
|
||||
volumes:
|
||||
- /data/beta.chaospott.de/repo/:/repo
|
||||
- /data/beta.chaospott.de/static/:/static
|
||||
- ${DATA_ROOT}/repo/:/repo
|
||||
- ${DATA_ROOT}/static/:/static
|
||||
nginx:
|
||||
image: nginx:latest
|
||||
restart: always
|
||||
volumes:
|
||||
- /data/beta.chaospott.de/static/:/usr/share/nginx/html
|
||||
- ${DATA_ROOT}/static/:/usr/share/nginx/html
|
||||
- ./nginx:/etc/nginx
|
||||
labels:
|
||||
- "traefik.frontend.rule=Host:beta.chaospott.de"
|
||||
- "traefik.port=80"
|
||||
- "traefik.docker.network=web"
|
||||
- traefik.frontend.rule=Host:beta.chaospott.de
|
||||
- traefik.port=80
|
||||
- traefik.docker.network=web
|
||||
networks:
|
||||
- extern
|
||||
expose:
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
exe() {
|
||||
echo "running $@"
|
||||
$@
|
||||
}
|
||||
SITE_REPO="https://git.chaospott.de/zehka/site.git"
|
||||
echo "Where should the site store all volumes?"
|
||||
read -p "PATH: " VOLUMES_PATH
|
||||
read -p "Hook endpoint ID (just make something up):" ENDPOINT_ID
|
||||
read -p "Hook endpoint Password:" ENDPOINT_PW
|
||||
echo "Creating volumes structure"
|
||||
exe mkdir $VOLUMES_PATH
|
||||
exe git clone $SITE_REPO $VOLUMES_PATH/repo
|
||||
exe cp -rv configs/webhook $VOLUMES_PATH/webhook
|
||||
echo """[
|
||||
{
|
||||
\"id\": \"$ENDPOINT_ID\",
|
||||
\"execute-command\": \"/webhook/reload.sh\",
|
||||
\"command-working-directory\": \"/repo\",
|
||||
\"match\":
|
||||
{
|
||||
\"secret\": \"$ENDPOINT_PW\"
|
||||
}
|
||||
}
|
||||
]""" > $VOLUMES_PATH/webhook/hooks.json
|
||||
VOLUMES_PATH_SANITIZED=$(echo $VOLUMES_PATH | sed 's/\/$//g')
|
||||
echo "DATA_ROOT=$VOLUMES_PATH_SANITIZED" > .env
|
||||
Reference in new issue
Block a user