Add a job to update translation

See https://pagure.io/fedora-infrastructure/issue/8691
This commit is contained in:
Michael Scherer 2020-04-07 14:50:14 +02:00 committed by Pierre-Yves Chibon
parent a512f15c52
commit 547f5bc938
4 changed files with 66 additions and 0 deletions

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"