Skip to content

Commit e1fcbb1

Browse files
authored
Drop redundant copy of checkout, run in pod (#750)
Signed-off-by: Matthias Büchse <matthias.buechse@cloudandheat.com>
1 parent 90f3244 commit e1fcbb1

5 files changed

Lines changed: 20 additions & 28 deletions

File tree

.zuul.d/config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- job:
1919
name: scs-check-adr-syntax
2020
parent: base
21+
nodeset: pod-fedora-40
2122
pre-run: playbooks/pre.yaml
2223
run: playbooks/adr_syntax.yaml
2324
- job:
@@ -26,6 +27,7 @@
2627
secrets:
2728
- name: clouds_conf
2829
secret: SECRET_STANDARDS
30+
nodeset: pod-fedora-40
2931
vars:
3032
preset: default
3133
pre-run:

playbooks/adr_syntax.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
hosts: all
44
tasks:
55
- name: Run ADR syntax check script
6-
ansible.builtin.shell: |
7-
python3 ~/Tests/chk_adrs.py ~/Standards
6+
ansible.builtin.command:
7+
cmd: python3 Tests/chk_adrs.py Standards
8+
chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
89
register: result
910
changed_when: true
1011
failed_when: result.rc != 0
1112

1213
- name: Run test script consistency check script
13-
ansible.builtin.shell: |
14-
python3 ~/Tests/iaas/flavor-naming/check_yaml.py ~/Tests/iaas
14+
ansible.builtin.shell:
15+
cmd: python3 Tests/iaas/flavor-naming/check_yaml.py Tests/iaas
16+
chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
1517
register: result
1618
changed_when: true
1719
failed_when: result.rc != 0

playbooks/compliance_check.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
hosts: all
44
tasks:
55
- name: Run compliance script
6-
ansible.builtin.shell: >
7-
python3 ~/Tests/scs-test-runner.py --config ~/Tests/config.toml --debug run --preset {{ preset }} --output report.yaml
6+
ansible.builtin.command:
7+
cmd: python3 Tests/scs-test-runner.py --config Tests/config.toml --debug run --preset {{ preset }} --output report.yaml
8+
chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
89
changed_when: true
910

1011
- name: Copy result YAML
1112
ansible.builtin.synchronize:
1213
dest: "{{ zuul.executor.log_root }}/report.yaml"
1314
mode: pull
14-
src: "report.yaml"
15+
src: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/report.yaml"
1516
verify_host: true
1617
owner: no
1718
group: no

playbooks/pre.yaml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,7 @@
44
roles:
55
- role: ensure-pip # https://zuul-ci.org/docs/zuul-jobs/latest/python-roles.html#role-ensure-pip
66
tasks:
7-
- name: Copy ADRs on the node
8-
ansible.builtin.copy:
9-
src: "../Standards"
10-
dest: "~/"
11-
mode: 0500
12-
no_log: false
13-
14-
- name: Copy Tests on the node
15-
ansible.builtin.copy:
16-
src: "../Tests"
17-
dest: "~/"
18-
mode: 0500
19-
no_log: false
20-
217
- name: Install dependencies
228
ansible.builtin.pip:
23-
requirements: ~/Tests/requirements.txt
9+
chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
10+
requirements: "Tests/requirements.txt"

playbooks/pre_cloud.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
- name: Prepare cloud config and ensure clean env
33
hosts: all
44
roles:
5-
- role: ensure-pip # https://zuul-ci.org/docs/zuul-jobs/latest/python-roles.html#role-ensure-pip
65
- role: bindep # https://zuul-ci.org/docs/zuul-jobs/latest/general-roles.html#role-bindep
76
tasks:
87
- name: Create cloud config dir
@@ -21,7 +20,7 @@
2120

2221
- name: Create secrets dir
2322
ansible.builtin.file:
24-
path: "~/Tests/.secret"
23+
path: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/Tests/.secret"
2524
state: directory
2625
recurse: true
2726
mode: "0700"
@@ -30,18 +29,19 @@
3029
ansible.builtin.copy:
3130
# the secrets are usually stripped of whitespace, but the final newline is essential here
3231
content: "{{ clouds_conf.zuul_ci_signing_key + '\n' }}"
33-
dest: "~/Tests/.secret/keyfile"
32+
dest: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/Tests/.secret/keyfile"
3433
mode: "0600"
3534
no_log: true
3635

3736
- name: Create basic_auth token file
3837
ansible.builtin.copy:
3938
content: "{{ clouds_conf.zuul_ci_basic_auth }}"
40-
dest: "~/Tests/.secret/tokenfile"
39+
dest: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/Tests/.secret/tokenfile"
4140
mode: "0600"
4241
no_log: true
4342

4443
- name: Clean up any lingering resources from previous run
45-
ansible.builtin.shell: >
46-
python3 ~/Tests/scs-test-runner.py --config ~/Tests/config.toml --debug cleanup --preset {{ preset }}
44+
ansible.builtin.command:
45+
cmd: python3 Tests/scs-test-runner.py --config Tests/config.toml --debug cleanup --preset {{ preset }}
46+
chdir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}"
4747
changed_when: true

0 commit comments

Comments
 (0)