-
Notifications
You must be signed in to change notification settings - Fork 7
/
deploy-and-test.yml
196 lines (187 loc) · 6.88 KB
/
deploy-and-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
---
- name: Test RHSCL container images on OpenShift 4
hosts: "{{ hosts | default('localhost') }}"
vars:
testing_dir: "/tmp/rhscl_openshift_dir"
github_repo: "{{ lookup('env', 'GITHUB_REPO')}}"
ext_test: "{{ lookup('env', 'EXT_TEST') }}"
xml_file_name: "rhscl-testing-results.xml"
xml_file: "{{ testing_dir }}/{{ xml_file_name }}"
xml_testsuite_path: "/testsuite"
xml_testcase_path: "{{ xml_testsuite_path }}/testcase"
oc_project_rhscl: "core-services-ocp--rhscl-ci"
oc_project_dotnet: "core-services-ocp--dotnet-ci"
java_8:
- java-8-container
java_11:
- java-11-container
java_17:
- java-17-container
java: "{{ java_8 + java_11 + java_17 }}"
dotnet_60:
- rhel8-dotnet60-container
dotnet_70:
- rhel8-dotnet70-container
dotnet: "{{ dotnet_60 + dotnet_70}}"
tasks:
- debug: var=ext_test
- debug: var=github_repo
- name: Modify OpenShift project to rhscl-ci-testing-s2i if s2i
set_fact:
oc_project_rhscl: "{{ oc_project_rhscl }}-s2i"
when: (ext_test is defined) and (ext_test == "s2i")
- name: Modify OpenShift project to rhscl-ci-testing-nos2i if nos2i
set_fact:
oc_project_rhscl: "{{ oc_project_rhscl }}-nos2i"
when: (ext_test is defined) and (ext_test == "nos2i")
- name: Check temporary directory and create XML unit file
block:
- name: Remove directory
file:
state: absent
path: "{{ testing_dir }}"
- name: Create temporary directory
file:
state: directory
path: "{{ testing_dir }}"
- name: Copy results template file
copy:
src: ./vars/{{ xml_file_name }}
dest: "{{ xml_file }}"
- block:
- name: Check if KUBECONFIG is defined
command: echo "$KUBECONFIG"
register: kube
- name: check if kubeconfig is set
assert:
that:
- kube.stdout != ""
msg: "KUBECONFIG is not defined"
changed_when: false
ignore_errors: no
- name: Clone and test upstream container repositories
include_tasks: ./tasks/verify_in_openshift.yml
loop:
- rhel8-nodejs-ex-18
- rhel8-nodejs-ex-18-minimal
- rhel8-nodejs-ex-20
- rhel8-nodejs-ex-20-minimal
- rhel8-cakephp-ex-73
- rhel8-cakephp-ex-74
#- rhel8-cakephp-ex-80 It looks like no prepared for PHP-8.0
#- rhel8-cakephp-ex-81 It looks like no prepared for PHP-8.0
- rhel8-httpd-ex
- rhel8-django-ex-python-36
- rhel8-django-ex-python-38
- rhel8-mariadb-105-container
- rhel8-mariadb-1011-container
- rhel8-s2i-perl-532-container
- rhel8-s2i-perl-526-container
- rhel8-s2i-python-36-container
- rhel8-s2i-python-39-container
- rhel8-s2i-python-311-container
- rhel8-s2i-python-312-container
- rhel8-postgresql-12-container
- rhel8-postgresql-13-container
- rhel8-postgresql-15-container
- rhel8-postgresql-16-container
- rhel8-s2i-ruby-25-container
- rhel8-s2i-ruby-31-container
- rhel8-s2i-ruby-33-container
- rhel8-mysql-80-container
- rhel8-nginx-ex-122
- rhel8-nginx-ex-124
- rhel9-httpd-ex
- rhel9-mariadb-105-container
- rhel9-mariadb-1011-container
- rhel9-mysql-80-container
- rhel9-nginx-ex-122
- rhel9-nginx-ex-124
- rhel9-nodejs-ex-18
- rhel9-nodejs-ex-18-minimal
- rhel9-nodejs-ex-20
- rhel9-nodejs-ex-20-minimal
- rhel9-postgresql-13-container
- rhel9-postgresql-15-container
- rhel9-postgresql-16-container
- rhel9-s2i-perl-532-container
- rhel9-s2i-python-39-container
- rhel9-s2i-python-311-container
- rhel9-s2i-python-312-container
- rhel9-s2i-ruby-30-container
- rhel9-s2i-ruby-31-container
- rhel9-s2i-ruby-33-container
when: (github_repo == "") and (ext_test == "")
- name: Check None-s2i containers
include_tasks: ./tasks/verify_in_openshift.yml
loop:
- rhel8-httpd-ex
- rhel8-mariadb-105-container
- rhel8-mariadb-1011-container
- rhel8-postgresql-12-container
- rhel8-postgresql-13-container
- rhel8-postgresql-15-container
- rhel8-postgresql-16-container
- rhel8-mysql-80-container
- rhel8-nginx-ex-122
- rhel8-nginx-ex-124
- rhel9-httpd-ex
- rhel9-mariadb-105-container
- rhel9-mariadb-1011-container
- rhel9-mysql-80-container
- rhel9-nginx-ex-122
- rhel9-nginx-ex-124
- rhel9-postgresql-13-container
- rhel9-postgresql-15-container
- rhel9-postgresql-16-container
when: (github_repo == "") and (ext_test is defined) and (ext_test == "nos2i")
- name: Check s2i containers
include_tasks: ./tasks/verify_in_openshift.yml
loop:
- rhel8-nodejs-ex-18
- rhel8-nodejs-ex-18-minimal
- rhel8-nodejs-ex-20
- rhel8-nodejs-ex-20-minimal
- rhel8-cakephp-ex-74
#- rhel8-cakephp-ex-80 It looks like no prepared for PHP-8.0
#- rhel8-cakephp-ex-81 It looks like no prepared for PHP-8.0
- rhel8-django-ex-python-36
- rhel8-django-ex-python-38
- rhel8-s2i-perl-532-container
- rhel8-s2i-perl-526-container
- rhel8-s2i-python-36-container
- rhel8-s2i-python-39-container
- rhel8-s2i-python-311-container
- rhel8-s2i-python-312-container
- rhel8-s2i-ruby-25-container
- rhel8-s2i-ruby-31-container
- rhel8-s2i-ruby-33-container
- rhel9-nodejs-ex-18
- rhel9-nodejs-ex-18-minimal
- rhel9-nodejs-ex-20
- rhel9-nodejs-ex-20-minimal
- rhel9-nodejs-ex-22
- rhel9-nodejs-ex-22-minimal
- rhel9-s2i-perl-532-container
- rhel9-s2i-python-39-container
- rhel9-s2i-python-311-container
- rhel9-s2i-python-312-container
- rhel9-s2i-ruby-30-container
- rhel9-s2i-ruby-31-container
- rhel9-s2i-ruby-33-container
when: (github_repo == "") and (ext_test is defined) and (ext_test == "s2i")
- name: Clone and test only one upstream container repository
include_tasks: ./tasks/verify_in_openshift.yml
loop:
- "{{ github_repo }}"
when: (github_repo is defined) and (github_repo != "") and (ext_test == "")
- name: Check java container
include_tasks: ./plugins/verify_java.yml
loop: "{{ lookup('vars', ext_test) }}"
when: (ext_test is defined) and (ext_test in
["java", "java_8", "java_11", "java_17"])
- name: Check dotnet containers
include_tasks: ./tasks/verify_in_openshift.yml
loop: "{{ lookup('vars', ext_test) }}"
when: (ext_test is defined) and (ext_test in
["dotnet", "dotnet_60", "dotnet_70"])