Files
fedora-infra_ansible/roles/fedora-docs/build/templates/docs-sync.j2
2018-08-01 19:51:25 +00:00

43 lines
1.1 KiB
Django/Jinja
Executable File

#!/bin/sh
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/fedora-docs-web.git docs
{% endif %}
fi
cd /srv/web/docs
/usr/bin/git reset -q --hard
{% if env == 'staging' %}
/usr/bin/git checkout -q stg
{% else %}
/usr/bin/git checkout -q prod
{% endif %}
/usr/bin/git pull -q --ff-only
if [ ! -d /srv/web/docs-redirects ]
then
echo "/srv/web/docs-redirects missing"
cd /srv/web
{% if env == 'staging' %}
git clone --branch redirects-stg https://pagure.io/fedora-docs/fedora-docs-web.git docs-redirects
{% else %}
git clone --branch redirects https://pagure.io/fedora-docs/fedora-docs-web.git docs-redirects
{% endif %}
fi
cd /srv/web/docs-redirects
/usr/bin/git reset -q --hard
{% if env == 'staging' %}
/usr/bin/git checkout -q redirects-stg
{% else %}
/usr/bin/git checkout -q redirects
{% endif %}
/usr/bin/git pull -q --ff-only