Browse Source

Improve generate_atc Ansible playbook

- fetch project list automatically
- provide test data (not sure if we can provide real data which are
already published in governance repo and wiki)

Change-Id: I1c2144f794932048ce3c8cf26f3457abaa3dec34
changes/99/633399/2
Frank Kloeker 3 years ago
parent
commit
f676f207d9
  1. 3
      .gitignore
  2. 17
      playbooks/generate_atc.yml
  3. 3
      playbooks/vars/zanata_stats_output.csv
  4. 3
      playbooks/vars/zanata_userinfo_output.csv

3
.gitignore

@ -12,3 +12,6 @@ dist/
# Testenvironment
.tox/
# Retry files form Ansible
*.retry

17
playbooks/generate_atc.yml

@ -17,15 +17,15 @@
# usage: ansible-playbook generate_atc.yml
#
# The output can be found in /tmp/atc.stats
#
# The full workflow is described in https://wiki.openstack.org/wiki/I18n_Extra-ATC_collection
- hosts: localhost
gather_facts: "no"
vars:
userstatsfile: "zanata_stats_output.csv"
userinfofile: "zanata_userinfo_output.csv"
userstatsfile: "vars/zanata_stats_output.csv"
userinfofile: "vars/zanata_userinfo_output.csv"
translatecount: 300
workingdir: "/tmp/atc.output"
vars_files:
- "projects.yaml"
tasks:
- name: create working dir
@ -33,6 +33,15 @@
path: "{{ workingdir }}"
state: directory
- name: fetch projects list
get_url:
url: https://git.openstack.org/cgit/openstack/governance/plain/reference/projects.yaml
dest: vars/
force: True
- name: include projects.yaml var
include_vars: vars/projects.yaml
- name: read old atc list
vars:
extraatcs: "{{ I18n['extra-atcs'] }}"

3
playbooks/vars/zanata_stats_output.csv

@ -0,0 +1,3 @@
user_id,lang,project,version,translation-total,translated,needReview,approved,rejected,review-total,review-approved,review-rejected
user1,zh-CN,-,-,130,130,0,0,0,0,0,0
user2,de,-,-,10000,10000,2,1,0,1,1,0

3
playbooks/vars/zanata_userinfo_output.csv

@ -0,0 +1,3 @@
user_id,lang_code,lang,name,email
user1,zh-CN,Chinese (China),User One,user1@example.com
user2,de,German,User Two,user2@example.com
Loading…
Cancel
Save