Skip to content
Snippets Groups Projects
Commit 78f540b4 authored by Pierre Ozoux's avatar Pierre Ozoux
Browse files

Fixes #21 - gitpuller working

parent e78ce5b7
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
cd /data/per-user/$USER/$APP/data/www-content && git pull
[Unit]
Description=Start the timer if there is a GITURL file
# Dependency binding
BindsTo=nginx@%i.service
[Path] [Path]
PathExists=/data/per-user/%i/nginx/data/GITURL PathExists=/data/per-user/%i/nginx/data/GITURL
Unit=nginx-gitpuller@%i.timer
[Unit] [Unit]
Description= git puller Description=git puller
[Service] [Service]
Type=oneshot Type=oneshot
RemainAfterExit=yes ExecStart=/bin/bash -euxc ' \
Environment=USER=%i app=`echo %p | cut -d"-" -f1`; \
Environment=APP=nginx cd /data/per-user/%i/$app/data/www-content; \
ExecStart=/data/indiehosters/importers/gitpuller.sh git pull'
[Unit] [Unit]
Description=Run git puller every 10 minutes Description=Run git puller service every 10 minutes
# Dependency binding
BindsTo=nginx-gitpuller@%i.path
[Timer] [Timer]
OnUnitActiveSec=10min OnUnitActiveSec=10min
......
...@@ -5,7 +5,7 @@ Description=%p-%i ...@@ -5,7 +5,7 @@ Description=%p-%i
Requires=docker.service Requires=docker.service
Requires=%p-importer@%i.service Requires=%p-importer@%i.service
Requires=%p-discovery@%i.service Requires=%p-discovery@%i.service
Wants=%p-gitpuller@%i.service Requires=%p-gitpuller@%i.path
# Dependency ordering # Dependency ordering
After=docker.service After=docker.service
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment