Skip to content
Snippets Groups Projects
Commit 164916f1 authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-inventories/arocom#1603 Improve update script

parent 3639b092
Branches
No related tags found
No related merge requests found
......@@ -26,7 +26,7 @@
- name: "Create Update Script"
template:
src='scripts/update/gitscript'
src='scripts/update/gitscript.jinja2'
dest='{{ webRoot }}/.update'
owner='root'
group='root'
......
......@@ -6,6 +6,20 @@ date
{% set path=[webRoot, drupal.src.git.target2|default(drupal.src.git.target)]|join('') %}
cd {{ path }}
echo '> check for changes'
OUTPUT=$(git remote show origin)
if [[ $OUTPUT == *"master pushes to master (up to date)"* ]]; then
echo "> unchanged, cancel"
exit
fi
LOCKFILE={{ webRoot }}/.update.lock
if [ -f '$LOCKFILE' ]; then
echo '> locked'
exit
fi
touch '$LOCKFILE'
echo '> chown/chmod'
chown -R {{ apacheUser }}:{{ apacheUser }} {{ path }}
chmod -R g+w {{ path }}
......@@ -39,4 +53,7 @@ if [ -f 'post-update.sh' ]; then
./post-update.sh
fi
rm '$LOCKFILE'
echo '> done'
echo;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment