forked from thunix/ansible
Adding wiki githook stuff
This commit is contained in:
parent
4340424c75
commit
f9b314f961
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
export RUNNING="/dev/shm/wiki_is_running"
|
||||||
|
|
||||||
|
if [ -f $RUNNING ]; then
|
||||||
|
echo "wiki is currently running."
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
touch $RUNNING
|
||||||
|
cd /var/www/wiki.thunix.net
|
||||||
|
/usr/bin/git pull
|
||||||
|
touch /dev/shm/wiki-hook-last-run
|
||||||
|
rm $RUNNING
|
||||||
|
exit 0
|
||||||
|
fi
|
|
@ -0,0 +1,6 @@
|
||||||
|
[Unit]
|
||||||
|
Description=wiki-run path
|
||||||
|
[Path]
|
||||||
|
PathModified=/dev/shm/run-wiki
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -0,0 +1,4 @@
|
||||||
|
[Unit]
|
||||||
|
Description=wiki-run
|
||||||
|
[Service]
|
||||||
|
ExecStart=/usr/local/bin/wiki-run
|
|
@ -53,6 +53,30 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0644
|
mode: 0644
|
||||||
|
|
||||||
|
- name: Add githook for wiki local script
|
||||||
|
copy:
|
||||||
|
src: ../files/wiki-run
|
||||||
|
dest: /usr/local/bin/wiki-run
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0755
|
||||||
|
|
||||||
|
- name: Add wiki githook system path unit
|
||||||
|
copy:
|
||||||
|
src: ../files/wiki-run.path
|
||||||
|
dest: /etc/systemd/system/wiki-run.path
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
|
||||||
|
- name: Add wiki githook service unit
|
||||||
|
copy:
|
||||||
|
src: ../files/wiki-run.service
|
||||||
|
dest: /etc/systemd/system/wiki-run.service
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0644
|
||||||
|
|
||||||
- name: Enabling ansible-pull units
|
- name: Enabling ansible-pull units
|
||||||
systemd:
|
systemd:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
|
@ -60,3 +84,5 @@
|
||||||
with_items:
|
with_items:
|
||||||
- 'www-run.path'
|
- 'www-run.path'
|
||||||
- 'www-run.service'
|
- 'www-run.service'
|
||||||
|
- 'wiki-run.path'
|
||||||
|
- 'wiki-run.service'
|
||||||
|
|
Loading…
Reference in New Issue