From 22f38756dd298a4e45149ecc2dbc68d7ed1deb46 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Sat, 29 Aug 2015 00:12:09 +0200 Subject: Don't fetch website in buildscript during ansible run --- roles/sublab_web/handlers/as_webuser.yaml | 2 +- roles/sublab_web/templates/website-rebuild.sh.j2 | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/roles/sublab_web/handlers/as_webuser.yaml b/roles/sublab_web/handlers/as_webuser.yaml index 11e8074..48f2765 100644 --- a/roles/sublab_web/handlers/as_webuser.yaml +++ b/roles/sublab_web/handlers/as_webuser.yaml @@ -1,5 +1,5 @@ --- - name: Rebuild subweb website - shell: ./website-rebuild.sh + shell: ./website-rebuild.sh -l args: chdir: "/var/www/{{sublab_web_server_name}}" diff --git a/roles/sublab_web/templates/website-rebuild.sh.j2 b/roles/sublab_web/templates/website-rebuild.sh.j2 index 1e4bc0b..ac29e3d 100644 --- a/roles/sublab_web/templates/website-rebuild.sh.j2 +++ b/roles/sublab_web/templates/website-rebuild.sh.j2 @@ -4,8 +4,11 @@ # cd /var/www/{{sublab_web_server_name}}/htdocs -git fetch git://{{ groups['gitservers'][0] }}/website.git master -git reset --hard FETCH_HEAD + +if [ x"$1" != x"-l" ]; then + git fetch git://{{ groups['gitservers'][0] }}/website.git master + git reset --hard FETCH_HEAD +fi cd scripts python template.py python wikitemplate.py > ../../wiki-page.tmpl -- cgit v1.2.1