summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Fenzi <kevin@scrye.com>2017-08-24 20:44:39 +0000
committerKevin Fenzi <kevin@scrye.com>2017-08-24 20:44:39 +0000
commitdc19d02b1d30e659ff0a0c877d5351ea29cfb49a (patch)
tree2891a6131e509e4997c645b3da3c5bf483b355e1
parent697888841516c0d9704225b360f88f85aa48572b (diff)
downloadansible-dc19d02b1d30e659ff0a0c877d5351ea29cfb49a.tar.gz
ansible-dc19d02b1d30e659ff0a0c877d5351ea29cfb49a.tar.xz
ansible-dc19d02b1d30e659ff0a0c877d5351ea29cfb49a.zip
Test out the new docs publishing in staging
-rw-r--r--roles/fedora-docs/build/tasks/main.yml4
-rwxr-xr-xroles/fedora-docs/build/templates/docs-sync.j2 (renamed from roles/fedora-docs/build/files/docs-sync)11
2 files changed, 11 insertions, 4 deletions
diff --git a/roles/fedora-docs/build/tasks/main.yml b/roles/fedora-docs/build/tasks/main.yml
index d7fd7de83..a1950b65f 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
index 5aa68ae39..978510614 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