Skip to content

Commit 221f103

Browse files
allow to test changes from nfv-example-cnf-deploy
1 parent 252952d commit 221f103

File tree

3 files changed

+41
-20
lines changed

3 files changed

+41
-20
lines changed

testpmd/hooks/install.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
2+
23
- name: Deploy the Example CNF applications
34
include_role:
4-
name: "{{ dci_config_dir }}/hooks/{{ cluster_name }}/nfv-example-cnf-deploy/roles/example-cnf-app"
5+
name: "{{ deploy_dir }}/roles/example-cnf-app"
56

67
- name: Apply configuration for CNF Cert Suite execution
78
include_role:

testpmd/hooks/pre-run.yml

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
with_items: "{{ hostvars.localhost.job_info.job.components }}"
2020
when: item["type"] == "nfv-example-cnf-index"
2121

22-
- name: Check change presence
22+
- name: Check example-cnf change presence
2323
block:
2424
- name: Check if example-cnf is part of the change
2525
stat:
@@ -28,8 +28,9 @@
2828

2929
- block:
3030
- name: Generate versions
31-
shell: "./generate-versions.sh {{ job_logs.path }}/versions.cfg pr$(jq -r .number ../example-cnf-[0-9]*.json).$(jq -r .head.sha ../example-cnf-[0-9]*.json|cut -c1-8)"
31+
shell: 'JSON=$(ls ../example-cnf-[0-9]*.json); if [ -z "$JSON" ]; then JSON=../github.json; fi; ./generate-versions.sh {{ job_logs.path }}/versions.cfg pr$(jq -r .number $JSON).$(jq -r .head.sha $JSON|cut -c1-8)'
3232
args:
33+
executable: /bin/bash
3334
chdir: "{{ dci_change_dir }}/example-cnf"
3435

3536
- name: Get index version
@@ -52,13 +53,23 @@
5253
example_cnf_index_image: "quay.io/rh-nfv-int/nfv-example-cnf-catalog:{{ index_output.stdout }}"
5354
app_version: "{{ app_output.stdout }}"
5455

55-
# - name: 'Remove component from the job'
56-
# dci_job_component:
57-
# component_id: "{{ git_operator_component_id }}"
58-
# job_id: " {{ job_id }} "
59-
# state: absent
56+
- name: 'Remove component from the job'
57+
dci_job_component:
58+
component_id: "{{ operator_component_id }}"
59+
job_id: " {{ job_id }} "
60+
state: absent
6061

6162
when: examplecnf_change_dir.stat.exists and examplecnf_change_dir.stat.isdir
63+
64+
- name: Check if nfv-example-cnf-deploy is part of the change
65+
stat:
66+
path: "{{ dci_change_dir }}/nfv-example-cnf-deploy"
67+
register: deploy_change_dir
68+
69+
- name: Override the deploy_dir variable
70+
set_fact:
71+
deploy_dir: "{{ dci_change_dir }}/nfv-example-cnf-deploy"
72+
when: deploy_change_dir.stat.exists and deploy_change_dir.stat.isdir
6273
when:
6374
- dci_change_dir is defined
6475

@@ -153,16 +164,6 @@
153164
ignore_errors: true
154165
no_log: true
155166

156-
- name: Checkout Example CNF deployment role
157-
git:
158-
repo: "https://github.com/rh-nfv-int/nfv-example-cnf-deploy.git"
159-
dest: "{{ dci_config_dir }}/hooks/{{ cluster_name }}/nfv-example-cnf-deploy"
160-
version: "{{ example_cnf_deploy_script_version|default('master') }}"
161-
update: yes
162-
register: gitresult
163-
164-
- debug: msg="Git hash is {{ gitresult.after }}"
165-
166167
- name: "Install required rpm packages"
167168
package:
168169
name:
@@ -174,13 +175,32 @@
174175
state: latest
175176
become: true
176177

178+
- block:
179+
- name: Checkout Example CNF deployment roles
180+
git:
181+
repo: "https://github.com/rh-nfv-int/nfv-example-cnf-deploy.git"
182+
dest: "{{ dci_config_dir }}/hooks/{{ cluster_name }}/nfv-example-cnf-deploy"
183+
version: "{{ example_cnf_deploy_script_version|default('master') }}"
184+
update: true
185+
register: gitresult
186+
187+
- debug: msg="Git hash is {{ gitresult.after }}"
188+
189+
- name: Set the deploy_dir variable
190+
set_fact:
191+
deploy_dir: "{{ dci_config_dir }}/hooks/{{ cluster_name }}/nfv-example-cnf-deploy"
192+
193+
when:
194+
- deploy_dir is not defined
195+
196+
177197
- name: Mirror catalog in disconnected environment
178198
include_tasks: mirror-catalog.yml
179199
when:
180200
- dci_disconnected | default(false) | bool
181201

182202
- name: Deploy NFV Example CNF catalog
183203
include_role:
184-
name: "{{ dci_config_dir }}/hooks/{{ cluster_name }}/nfv-example-cnf-deploy/roles/example-cnf-catalog"
204+
name: "{{ deploy_dir }}/roles/example-cnf-catalog"
185205

186206
...

testpmd/hooks/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
- name: Run migration test
33
include_role:
4-
name: "{{ dci_config_dir }}/hooks/{{ cluster_name }}/nfv-example-cnf-deploy/roles/example-cnf-validate"
4+
name: "{{ deploy_dir }}/roles/example-cnf-validate"
55
when:
66
- run_migration_test|default(true)|bool
77

0 commit comments

Comments
 (0)