|
103 | 103 | # non-SSO login.
|
104 | 104 | # Installation step also installs based on this.
|
105 | 105 | Given /^I log in to jenkins$/ do
|
106 |
| - if env.version_ge("3.4", user: user) && user.password? |
| 106 | + if env.version_ge("3.4", user: user) && env.version_le("3.11", user: user) && user.password? |
107 | 107 | step %Q/I perform the :jenkins_oauth_login web action with:/, table(%{
|
108 | 108 | | username | <%= user.name %> |
|
109 | 109 | | password | <%= user.password %> |
|
110 | 110 | })
|
| 111 | + elsif env.version_gt("3.11", user: user) && user.password? |
| 112 | + step %Q/I perform the :jenkins_multi_oauth_login web action with:/, table(%{ |
| 113 | + | username | <%= user.name %> | |
| 114 | + | password | <%= user.password %> | |
| 115 | + }) |
111 | 116 | else
|
112 | 117 | step %Q/I perform the :jenkins_standard_login web action with:/, table(%{
|
113 | 118 | | username | admin |
|
|
118 | 123 | end
|
119 | 124 |
|
120 | 125 | Given /^I update #{QUOTED} slave image for jenkins #{NUMBER} server$/ do |slave_name,jenkins_version|
|
121 |
| - le39 = env.version_le("3.9", user: user) |
122 | 126 |
|
123 | 127 | step 'I store master major version in the clipboard'
|
124 |
| - if le39 or jenkins_version == '1' |
| 128 | + |
| 129 | + if env.version_gt("3.11", user: user) |
| 130 | + print "Skipped, agent images don't need update above openshift 4.0" |
| 131 | + elsif env.version_le("3.9", user: user) or jenkins_version == '1' |
125 | 132 | step %Q/I perform the :jenkins_update_cloud_image web action with:/, table(%{
|
126 | 133 | | currentimgval | registry.access.redhat.com/openshift3/jenkins-slave-#{slave_name}-rhel7 |
|
127 | 134 | | cloudimage | <%= product_docker_repo %>openshift3/jenkins-slave-#{slave_name}-rhel7:v<%= cb.master_version %> |
|
|
131 | 138 | | currentimgval | openshift3/jenkins-agent-maven-35-rhel7 |
|
132 | 139 | | cloudimage | <%= product_docker_repo %>openshift3/jenkins-agent-maven-35-rhel7:v<%= cb.master_version %> |
|
133 | 140 | })
|
134 |
| - elsif slave_name == 'nodejs' |
| 141 | + else slave_name == 'nodejs' |
135 | 142 | step %Q/I perform the :jenkins_update_cloud_image web action with:/, table(%{
|
136 | 143 | | currentimgval | openshift3/jenkins-agent-nodejs-8-rhel7 |
|
137 | 144 | | cloudimage | <%= product_docker_repo %>openshift3/jenkins-agent-nodejs-8-rhel7:v<%= cb.master_version %> |
|
|
140 | 147 |
|
141 | 148 | step 'the step should succeed'
|
142 | 149 | end
|
143 |
| - |
144 |
| -Given /^I have a jenkins server with above 40 cluster$/ do |
145 |
| - |
146 |
| - last_startup_check = monotonic_seconds |
147 |
| - if !user.password? |
148 |
| - step %Q/I run the :new_app client command with:/, table(%{ |
149 |
| - | p | ENABLE_OAUTH=false | |
150 |
| - | template | jenkins-persistent | |
151 |
| - }) |
152 |
| - step 'the step should succeed' |
153 |
| - else |
154 |
| - step %Q/I run the :new_app client command with:/, table(%{ |
155 |
| - | template | jenkins-persistent | |
156 |
| - }) |
157 |
| - step 'the step should succeed' |
158 |
| - end |
159 |
| - |
160 |
| - step 'I wait for the "jenkins" service to become ready up to 600 seconds' |
161 |
| - cb.jenkins_svc = service |
162 |
| - cache_resources *service.pods, route("jenkins", service("jenkins")) |
163 |
| - cb.jenkins_pod = pod |
164 |
| - cb.jenkins_route = route |
165 |
| - cb.jenkins_dns = cb.jenkins_route.dns |
166 |
| - cb.jenkins_major_version = 2 |
167 |
| - |
168 |
| - timeout = 600 |
169 |
| - wait_string = "Finished Download metadata." |
170 |
| - |
171 |
| - started = wait_for(timeout) { |
172 |
| - since = monotonic_seconds - last_startup_check |
173 |
| - res = user.cli_exec( |
174 |
| - :logs, |
175 |
| - resource_name: cb.jenkins_pod.name, |
176 |
| - since: "#{since.to_i + 5}s", |
177 |
| - _quiet: true |
178 |
| - ) |
179 |
| - last_startup_check += since |
180 |
| - res[:response].include? wait_string |
181 |
| - } |
182 |
| - if started |
183 |
| - logger.info "Jenkins log line found: #{wait_string}" |
184 |
| - else |
185 |
| - raise "Jenkins failed to start within #{timeout} seconds" |
186 |
| - end |
187 |
| -end |
188 |
| - |
189 |
| -Given /^I log into jenkins with above 40 cluster$/ do |
190 |
| - if user.password? |
191 |
| - step %Q/I perform the :jenkins_multi_oauth_login web action with:/, table(%{ |
192 |
| - | username | <%= user.name %> | |
193 |
| - | password | <%= user.password %> | |
194 |
| - }) |
195 |
| - else |
196 |
| - step %Q/I perform the :jenkins_standard_login web action with:/, table(%{ |
197 |
| - | username | admin | |
198 |
| - | password | password | |
199 |
| - }) |
200 |
| - end |
201 |
| - step 'the step should succeed' |
202 |
| -end |
0 commit comments