diff --git a/playbooks/groups/sundries.yml b/playbooks/groups/sundries.yml index d927da7be8..a6b9cd7256 100644 --- a/playbooks/groups/sundries.yml +++ b/playbooks/groups/sundries.yml @@ -45,6 +45,8 @@ when: master_sundries_node|bool - role: fedora-docs/build when: master_sundries_node|bool + - role: fedora-docs/translation + when: master_sundries_node|bool - role: membership-map/build when: master_sundries_node|bool - role: developer/build diff --git a/roles/fedora-docs/translation/files/cron-docs-translation-update b/roles/fedora-docs/translation/files/cron-docs-translation-update new file mode 100644 index 0000000000..bf91755bef --- /dev/null +++ b/roles/fedora-docs/translation/files/cron-docs-translation-update @@ -0,0 +1,2 @@ +MAILTO=jibecfed +0 2 * * * _update_docs_trans /usr/local/bin/lock-wrapper cron-docs-translation-update "/usr/local/bin/docs-translation-update" diff --git a/roles/fedora-docs/translation/files/docs-translation-update b/roles/fedora-docs/translation/files/docs-translation-update new file mode 100644 index 0000000000..f5e58e86ca --- /dev/null +++ b/roles/fedora-docs/translation/files/docs-translation-update @@ -0,0 +1,15 @@ +#!/bin/bash +OLD=$(mktemp -d -t fedora_docs_trans_XXXX) +cd $OLD + +function clean_tmp() { + [ -n "$OLD" ] && echo rm -Rf "$OLD" +} + +trap clean_tmp exit + +git clone https://pagure.io/fedora-docs/translations-scripts.git +cd translations-scripts +./build.py --clone_sources true --commit_l10n true --commit_tsources true --clone-po4a +./stats/compute.sh + diff --git a/roles/fedora-docs/translation/tasks/main.yml b/roles/fedora-docs/translation/tasks/main.yml new file mode 100644 index 0000000000..f731a60143 --- /dev/null +++ b/roles/fedora-docs/translation/tasks/main.yml @@ -0,0 +1,47 @@ +- name: Install packages + package: + name: + - po4a + - git + - perl-gettext + - perl-Pod-Parser + - perl(YAML::Tiny) + - perl(Unicode::GCString) + state: present + tags: + - fedora-docs-translation + +- name: Create a non root user to run the code + user: + name: _update_docs_trans + generate_ssh_key: yes + ssh_key_file: .ssh/id_rsa_docs_trans + tags: + - fedora-docs-translation + +# the key is going to be added to pagure for pushing +- name: Display the public key + command: cat ~_update_docs_trans/.ssh/id_rsa_docs_trans.pub + tags: + - fedora-docs-translation + +- copy: + src: docs-translation-update + dest: /usr/local/bin/docs-translation-update + owner: root + group: root + mode: 0755 + tags: + - fedora-docs-translation + +- copy: + src: cron-docs-translation-update + dest: /etc/cron.d/cron-docs-translation-update + owner: root + group: root + mode: 0644 + tags: + - fedora-docs-translation + when: env == "production" + +