File tree Expand file tree Collapse file tree 2 files changed +83
-0
lines changed Expand file tree Collapse file tree 2 files changed +83
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ - name : Store stestr timing data in internal repository
3+ hosts : localhost
4+ gather_facts : false
5+ vars :
6+ repo_path : " /tmp/timing-data"
7+ tests_log_dir : " {{ ansible_user_dir }}/ci-framework-data/tests/test_operator"
8+ timing_data_repo : " https://user:{{ git_token }}@gitlab.cee.redhat.com/ci-framework/timing-data"
9+ tasks :
10+ - name : Clone timing data repository
11+ ansible.builtin.git :
12+ repo : " {{ timing_data_repo }}"
13+ dest : " {{ repo_path }}"
14+ version : " main"
15+
16+ - name : Configure git settings
17+ community.general.git_config :
18+ repo : " {{ repo_path }}"
19+ scope : local
20+ name : " {{ item.name }}"
21+ value : " {{ item.value }}"
22+ loop :
23+ - {name: 'user.name', value: 'Zuul'}
24+ -
{name: 'user.email', value: '[email protected] '} 25+ - {name: 'remote.origin.url', value: '{{ timing_data_repo }}'}
26+
27+ - name : Find all 'tempest' directories
28+ ansible.builtin.find :
29+ paths : " {{ tests_log_dir }}"
30+ file_type : directory
31+ patterns : " *-tempest*"
32+ register : tempest_dirs
33+
34+ - name : Store timing data for every tempest-test directory
35+ ansible.builtin.include_tasks : tempest_store_timing_data_each.yaml
36+ vars :
37+ stestr_tar_path : " {{ tests_log_dir }}/{{ tempest_tests_name.path | basename }}/stestr.tar.gz"
38+ timing_data_repo_dir : " {{ repo_path }}/{{ job_name }}/{{ tempest_tests_name.path | basename }}"
39+ loop : " {{ tempest_dirs.files }}"
40+ loop_control :
41+ loop_var : tempest_tests_name
Original file line number Diff line number Diff line change 1+ ---
2+ #
3+ # Included by tempest_store_timing_data.yaml playbook
4+ #
5+ # There are two variables passed by the loop
6+ # - stestr_tar_path - a path to the data which will be copied
7+ # - timing_data_repo_dir - a path to a directory to be created
8+ #
9+ - name : Ensure the defined directory exists
10+ ansible.builtin.file :
11+ path : " {{ timing_data_repo_dir }}"
12+ state : directory
13+ mode : ' 0755'
14+
15+ - name : Copy timing data to commit
16+ ansible.builtin.copy :
17+ src : " {{ stestr_tar_path }}"
18+ dest : " {{ timing_data_repo_dir }}"
19+ mode : ' 0644'
20+
21+ - name : Add all changes
22+ ansible.builtin.command :
23+ cmd : git add .
24+ chdir : " {{ repo_path }}"
25+ changed_when : false
26+ # noqa command-instead-of-module
27+
28+ - name : Commit changes
29+ ansible.builtin.command :
30+ cmd : git commit -m "Automatic update"
31+ chdir : " {{ repo_path }}"
32+ register : commit_result
33+ changed_when : commit_result.rc == 0
34+ # noqa command-instead-of-module
35+
36+ - name : Push changes to the repository
37+ ansible.builtin.command :
38+ cmd : git push origin main
39+ chdir : " {{ repo_path }}"
40+ when : commit_result.rc == 0
41+ changed_when : false
42+ # noqa command-instead-of-module
You can’t perform that action at this time.
0 commit comments