| Andrea Frittoli (andreaf) | e4fdd2f | 2017-10-04 23:36:20 +0100 | [diff] [blame] | 1 | - name: Check if stackviz archive exists | 
|  | 2 | stat: | 
|  | 3 | path: "/opt/cache/files/stackviz-latest.tar.gz" | 
|  | 4 | register: stackviz_archive | 
|  | 5 |  | 
|  | 6 | - debug: | 
|  | 7 | msg: "Stackviz archive could not be found in /opt/cache/files/stackviz-latest.tar.gz" | 
|  | 8 | when: not stackviz_archive.stat.exists | 
|  | 9 |  | 
|  | 10 | - name: Check if subunit data exists | 
|  | 11 | stat: | 
| Michel Peterson | ac140fe | 2018-02-27 21:02:36 +0200 | [diff] [blame] | 12 | path: "{{ zuul_work_dir }}/testrepository.subunit" | 
| Andrea Frittoli (andreaf) | e4fdd2f | 2017-10-04 23:36:20 +0100 | [diff] [blame] | 13 | register: subunit_input | 
|  | 14 |  | 
|  | 15 | - debug: | 
| Michel Peterson | ac140fe | 2018-02-27 21:02:36 +0200 | [diff] [blame] | 16 | msg: "Subunit file could not be found at {{ zuul_work_dir }}/testrepository.subunit" | 
| Andrea Frittoli (andreaf) | e4fdd2f | 2017-10-04 23:36:20 +0100 | [diff] [blame] | 17 | when: not subunit_input.stat.exists | 
|  | 18 |  | 
|  | 19 | - name: Install stackviz | 
|  | 20 | pip: | 
|  | 21 | name: "file://{{ stackviz_archive.stat.path }}" | 
|  | 22 | virtualenv: /tmp/stackviz | 
|  | 23 | extra_args: -U | 
|  | 24 | when: | 
|  | 25 | - stackviz_archive.stat.exists | 
|  | 26 | - subunit_input.stat.exists | 
|  | 27 |  | 
|  | 28 | - name: Deploy stackviz static html+js | 
|  | 29 | command: cp -pR /tmp/stackviz/share/stackviz-html {{ stage_dir }}/stackviz | 
|  | 30 | when: | 
|  | 31 | - stackviz_archive.stat.exists | 
|  | 32 | - subunit_input.stat.exists | 
|  | 33 |  | 
|  | 34 | - name: Check if dstat data exists | 
|  | 35 | stat: | 
|  | 36 | path: "{{ devstack_base_dir }}/logs/dstat-csv.log" | 
|  | 37 | register: dstat_input | 
|  | 38 | when: | 
|  | 39 | - stackviz_archive.stat.exists | 
|  | 40 | - subunit_input.stat.exists | 
|  | 41 |  | 
|  | 42 | - name: Run stackviz with dstat | 
|  | 43 | shell: | | 
|  | 44 | cat {{ subunit_input.stat.path }} | \ | 
|  | 45 | /tmp/stackviz/bin/stackviz-export \ | 
|  | 46 | --dstat "{{ devstack_base_dir }}/logs/dstat-csv.log" \ | 
|  | 47 | --env --stdin \ | 
|  | 48 | {{ stage_dir }}/stackviz/data | 
|  | 49 | when: | 
|  | 50 | - stackviz_archive.stat.exists | 
|  | 51 | - subunit_input.stat.exists | 
|  | 52 | - dstat_input.stat.exists | 
| Jens Harbott | aacf6e8 | 2018-03-22 14:09:46 +0000 | [diff] [blame] | 53 | failed_when: False | 
| Andrea Frittoli (andreaf) | e4fdd2f | 2017-10-04 23:36:20 +0100 | [diff] [blame] | 54 |  | 
|  | 55 | - name: Run stackviz without dstat | 
|  | 56 | shell: | | 
|  | 57 | cat {{ subunit_input.stat.path }} | \ | 
|  | 58 | /tmp/stackviz/bin/stackviz-export \ | 
|  | 59 | --env --stdin \ | 
|  | 60 | {{ stage_dir }}/stackviz/data | 
|  | 61 | when: | 
|  | 62 | - stackviz_archive.stat.exists | 
|  | 63 | - subunit_input.stat.exists | 
|  | 64 | - not dstat_input.stat.exists | 
| Jens Harbott | aacf6e8 | 2018-03-22 14:09:46 +0000 | [diff] [blame] | 65 | failed_when: False |