diff --git a/roles/fedora-web/build/files/syncTranslations.stg.sh b/roles/fedora-web/build/files/syncTranslations.stg.sh new file mode 100644 index 0000000000..d8467e33e9 --- /dev/null +++ b/roles/fedora-web/build/files/syncTranslations.stg.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# this script pull all translations from the zanata Websites project. +# It pulls every resources. + +PO_DIR=/var/tmp/po_dir +SITES="alt.fedoraproject.org \ + boot.fedoraproject.org \ + fedoracommunity.org \ + fedorahosted.org \ + fedoraproject.org \ + getfedora.org \ + flocktofedora.org \ + spins.fedoraproject.org \ + labs.fedoraproject.org \ + budget.fedoraproject.org \ + arm.fedoraproject.org \ + start.fedoraproject.org" + +# hack for zanata-client, since it currently only is able to find +# config file in ~/.config/zanata.ini and apache's $HOME isn't a good location +export HOME=/var/lib/zanata + +[ -d $PO_DIR ] || mkdir $PO_DIR + +for site in $SITES +do + [ -d $PO_DIR/$site ] || mkdir -p $PO_DIR/$site + cp $HOME/sample.xml $PO_DIR/$site/zanata.xml + sed -i "s/@VERSION@/$site/" $PO_DIR/$site/zanata.xml + cd $PO_DIR/$site + zanata pull +done + diff --git a/roles/fedora-web/build/tasks/main.yml b/roles/fedora-web/build/tasks/main.yml index 962d06e75a..68ca326cd3 100644 --- a/roles/fedora-web/build/tasks/main.yml +++ b/roles/fedora-web/build/tasks/main.yml @@ -57,7 +57,14 @@ tags: - fedora-web -- name: Copy syncTranslations script +- name: Copy syncTranslations script (stg) + copy: > + src=syncTranslations.stg.sh dest=/usr/local/bin/syncTranslations.sh owner=root + group=root mode=0755 + tags: + - fedora-web + +- name: Copy syncTranslations script (prod) copy: > src=syncTranslations.sh dest=/usr/local/bin/syncTranslations.sh owner=root group=root mode=0755