From dc19d02b1d30e659ff0a0c877d5351ea29cfb49a Mon Sep 17 00:00:00 2001 From: Kevin Fenzi Date: Thu, 24 Aug 2017 20:44:39 +0000 Subject: [PATCH] Test out the new docs publishing in staging --- roles/fedora-docs/build/tasks/main.yml | 4 ++-- .../build/{files/docs-sync => templates/docs-sync.j2} | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) rename roles/fedora-docs/build/{files/docs-sync => templates/docs-sync.j2} (50%) diff --git a/roles/fedora-docs/build/tasks/main.yml b/roles/fedora-docs/build/tasks/main.yml index d7fd7de836..a1950b65f1 100644 --- a/roles/fedora-docs/build/tasks/main.yml +++ b/roles/fedora-docs/build/tasks/main.yml @@ -1,7 +1,7 @@ - file: dest=/srv/web/docs state=directory -- copy: > - src=docs-sync dest=/usr/local/bin/docs-sync +- template: > + src=docs-sync.j2 dest=/usr/local/bin/docs-sync owner=root group=root mode=0755 tags: - fedora-docs diff --git a/roles/fedora-docs/build/files/docs-sync b/roles/fedora-docs/build/templates/docs-sync.j2 similarity index 50% rename from roles/fedora-docs/build/files/docs-sync rename to roles/fedora-docs/build/templates/docs-sync.j2 index 5aa68ae39b..978510614d 100755 --- a/roles/fedora-docs/build/files/docs-sync +++ b/roles/fedora-docs/build/templates/docs-sync.j2 @@ -4,10 +4,17 @@ if [ ! -d /srv/web/docs ] then echo "/srv/web/docs missing" cd /srv/web +{% if env == 'staging' %} + git clone https://pagure.io/fedora-docs/fedora-docs-web.git docs +{% else %} git clone https://pagure.io/fedora-docs-web.git docs +{% endif %} fi cd /srv/web/docs -git reset -q --hard -git pull -q +/usr/bin/git reset -q --hard +{% if env == 'staging' %} +/usr/bin/git checkout -q stg +{% endif %} +/usr/bin/git pull -q --ff-only