diff --git a/importers/gitpuller.sh b/importers/gitpuller.sh index 034a40230396eca6cbdc19d9194c219b7a5603b8..2b37d98ef6d6050dd7c55c024d23ac0b5d2992ca 100755 --- a/importers/gitpuller.sh +++ b/importers/gitpuller.sh @@ -1,3 +1,3 @@ #!/bin/bash -cd /data/per-user/$USER/nginx/data/www-content && git pull +cd /data/per-user/$USER/$APP/data/www-content && git pull diff --git a/unit-files/gitpuller@.path b/unit-files/nginx-gitpuller@.path similarity index 100% rename from unit-files/gitpuller@.path rename to unit-files/nginx-gitpuller@.path diff --git a/unit-files/gitpuller@.service b/unit-files/nginx-gitpuller@.service similarity index 83% rename from unit-files/gitpuller@.service rename to unit-files/nginx-gitpuller@.service index e9c84909e0b41ae672779b5b4c7749febe258823..c3b09375044f1dd51ee8e09e969c2a723d6a80e1 100644 --- a/unit-files/gitpuller@.service +++ b/unit-files/nginx-gitpuller@.service @@ -3,4 +3,5 @@ Description= git puller [Service] Environment=USER=%i +Environment=APP=nginx ExecStart=/data/indiehosters/importers/gitpuller.sh diff --git a/unit-files/gitpuller@.timer b/unit-files/nginx-gitpuller@.timer similarity index 100% rename from unit-files/gitpuller@.timer rename to unit-files/nginx-gitpuller@.timer diff --git a/unit-files/nginx@.service b/unit-files/nginx@.service index 9b6c7333167051feb98f56457afac95a903fa502..48f6485c9a14ce8deb97a6ad37e7192f9d733996 100644 --- a/unit-files/nginx@.service +++ b/unit-files/nginx@.service @@ -5,7 +5,7 @@ Description=%p-%i Requires=docker.service Requires=%p-importer@%i.service Requires=%p-discovery@%i.service -Wants=gitpuller@%i.service +Wants=%p-gitpuller@%i.service # Dependency ordering After=docker.service diff --git a/unit-files/wordpress-subdir-gitpuller@.path b/unit-files/wordpress-subdir-gitpuller@.path new file mode 100644 index 0000000000000000000000000000000000000000..92ce7d1e3edb0a0edd499b8658d14500768314ac --- /dev/null +++ b/unit-files/wordpress-subdir-gitpuller@.path @@ -0,0 +1,2 @@ +[Path] +PathExists=/data/per-user/%i/wordpress-subdir/data/GITURL diff --git a/unit-files/wordpress-subdir-gitpuller@.service b/unit-files/wordpress-subdir-gitpuller@.service new file mode 100644 index 0000000000000000000000000000000000000000..8b65127b385517fcdb19799080ff54e220720c6c --- /dev/null +++ b/unit-files/wordpress-subdir-gitpuller@.service @@ -0,0 +1,7 @@ +[Unit] +Description= git puller + +[Service] +Environment=USER=%i +Environment=APP=wordpress-subdir +ExecStart=/data/indiehosters/importers/gitpuller.sh diff --git a/unit-files/wordpress-subdir-gitpuller@.timer b/unit-files/wordpress-subdir-gitpuller@.timer new file mode 100644 index 0000000000000000000000000000000000000000..78faa1e6b7c53e4b35d8a39962efd22cb93273eb --- /dev/null +++ b/unit-files/wordpress-subdir-gitpuller@.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Run git puller every 10 minutes + +[Timer] +OnUnitActiveSec=10min + +[Install] +WantedBy=timers.target diff --git a/unit-files/wordpress-subdir@.service b/unit-files/wordpress-subdir@.service index 201d7e1099c936554f194261c6fb2ddc9720e3f1..263f31e450260ec0bd05678e6da6342bde87a34b 100644 --- a/unit-files/wordpress-subdir@.service +++ b/unit-files/wordpress-subdir@.service @@ -7,7 +7,7 @@ Requires=etcd.service Requires=mysql@%i.service Requires=%p-importer@%i.service Requires=%p-discovery@%i.service -Wants=gitpuller@%i.service +Wants=%p-gitpuller@%i.service # Dependency ordering After=docker.service