22# Copyright 2018, 2019, Oracle Corporation and/or its affiliates. All rights reserved.
33# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
44
5- function pull_tag_build_images {
6- docker images
7-
8- if [ " $JRF_ENABLED " = true ] ; then
9- pull_tag_images_jrf
10- else
11- pull_tag_images
12- fi
13-
14- export JAR_VERSION=" ` grep -m1 " <version>" pom.xml | cut -f2 -d" >" | cut -f1 -d " <" ` "
15- # create a docker image for the operator code being tested
16- docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy --build-arg no_proxy=$no_proxy -t " ${IMAGE_NAME_OPERATOR} :${IMAGE_TAG_OPERATOR} " --build-arg VERSION=$JAR_VERSION --no-cache=true .
17- docker tag " ${IMAGE_NAME_OPERATOR} :${IMAGE_TAG_OPERATOR} " weblogic-kubernetes-operator:latest
18-
19- docker images
20-
21- }
22-
5+ # the below function is not used
236function docker_login {
247
258 set +x
@@ -78,7 +61,7 @@ function clean_shared_cluster {
7861 ${PROJECT_ROOT} /src/integration-tests/bash/cleanup.sh
7962}
8063
81- function pull_tag_images {
64+ function create_image_pull_secret_wl {
8265
8366 set +x
8467 if [ -z " $OCR_USERNAME " ] || [ -z " $OCR_PASSWORD " ]; then
@@ -90,7 +73,6 @@ function pull_tag_images {
9073
9174 if [ -n " $OCR_USERNAME " ] && [ -n " $OCR_PASSWORD " ]; then
9275 echo " Creating Docker Secret"
93-
9476 kubectl create secret docker-registry $IMAGE_PULL_SECRET_WEBLOGIC \
9577 --docker-server=${OCR_SERVER} / \
9678 --docker-username=$OCR_USERNAME \
@@ -103,11 +85,6 @@ function pull_tag_images {
10385 echo " secret $IMAGE_PULL_SECRET_WEBLOGIC was not created successfully"
10486 exit 1
10587 fi
106- # below docker pull is needed to get wlthint3client.jar from image to put in the classpath
107- # echo "docker login -u $OCR_USERNAME -p $OCR_PASSWORD ${OCR_SERVER}"
108- docker login -u $OCR_USERNAME -p $OCR_PASSWORD ${OCR_SERVER}
109- # echo "docker pull $IMAGE_NAME_WEBLOGIC:$IMAGE_TAG_WEBLOGIC"
110- docker pull $IMAGE_NAME_WEBLOGIC :$IMAGE_TAG_WEBLOGIC
11188 fi
11289 set -x
11390}
@@ -128,7 +105,7 @@ function pull_tag_images_jrf {
128105 fi
129106
130107 # reuse the create secret logic
131- pull_tag_images
108+ create_image_pull_secret_wl
132109
133110 # pull fmw infra images
134111 docker pull $IMAGE_NAME_FMWINFRA :$IMAGE_TAG_FMWINFRA
@@ -139,6 +116,7 @@ function pull_tag_images_jrf {
139116 set -x
140117}
141118
119+ # the below function is not used
142120function get_wlthint3client_from_image {
143121 # Get wlthint3client.jar from image
144122 id=$( docker create $IMAGE_NAME_WEBLOGIC :$IMAGE_TAG_WEBLOGIC )
@@ -233,50 +211,35 @@ if [ "$SHARED_CLUSTER" = "true" ]; then
233211 echo " When running in shared cluster option, provide DNS name or IP of a Kubernetes worker node using K8S_NODEPORT_HOST env variable"
234212 exit 1
235213 fi
236- pull_tag_images
214+ create_image_pull_secret_wl
237215
238216 fi
239217 setup_shared_cluster
240- get_wlthint3client_from_image
241218 docker images
242219
243220elif [ " $JENKINS " = " true" ]; then
244221
245222 echo " Test Suite is running on Jenkins and k8s is running locally on the same node."
223+ docker images
246224
247- # External customizable env vars unique to Jenkins:
248-
249- export docker_pass=${docker_pass:? }
250- export M2_HOME=${M2_HOME:? }
251- export K8S_VERSION=${K8S_VERSION}
252-
253- pull_tag_build_images
254-
255- /usr/local/packages/aime/ias/run_as_root " mkdir -p $PV_ROOT "
256- /usr/local/packages/aime/ias/run_as_root " mkdir -p $RESULT_ROOT "
257-
258- # 777 is needed because this script, k8s pods, and/or jobs may need access.
259-
260- /usr/local/packages/aime/ias/run_as_root " mkdir -p $RESULT_ROOT /acceptance_test_tmp"
261- /usr/local/packages/aime/ias/run_as_root " chmod 777 $RESULT_ROOT /acceptance_test_tmp"
262-
263- /usr/local/packages/aime/ias/run_as_root " mkdir -p $RESULT_ROOT /acceptance_test_tmp_archive"
264- /usr/local/packages/aime/ias/run_as_root " chmod 777 $RESULT_ROOT /acceptance_test_tmp_archive"
265-
266- /usr/local/packages/aime/ias/run_as_root " mkdir -p $PV_ROOT /acceptance_test_pv"
267- /usr/local/packages/aime/ias/run_as_root " chmod 777 $PV_ROOT /acceptance_test_pv"
225+ if [ " $JRF_ENABLED " = true ] ; then
226+ pull_tag_images_jrf
227+ else
228+ create_image_pull_secret_wl
229+ fi
268230
269- /usr/local/packages/aime/ias/run_as_root " mkdir -p $PV_ROOT /acceptance_test_pv_archive"
270- /usr/local/packages/aime/ias/run_as_root " chmod 777 $PV_ROOT /acceptance_test_pv_archive"
231+ export JAR_VERSION=" ` grep -m1 " <version>" pom.xml | cut -f2 -d" >" | cut -f1 -d " <" ` "
232+ # create a docker image for the operator code being tested
233+ docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy --build-arg no_proxy=$no_proxy -t " ${IMAGE_NAME_OPERATOR} :${IMAGE_TAG_OPERATOR} " --build-arg VERSION=$JAR_VERSION --no-cache=true .
234+ docker tag " ${IMAGE_NAME_OPERATOR} :${IMAGE_TAG_OPERATOR} " weblogic-kubernetes-operator:latest
271235
272- if [ " $JRF_ENABLED " = false ] && [ " $IMAGE_TAG_WEBLOGIC " != " 12.2.1.4-slim" ]; then
273- get_wlthint3client_from_image
274- fi
236+ docker images
237+
275238else
276239 if [ " $JRF_ENABLED " = true ] ; then
277240 pull_tag_images_jrf
278241 else
279- pull_tag_images
242+ create_image_pull_secret_wl
280243 fi
281244
282245 # docker rmi -f $(docker images -q -f dangling=true)
287250 export JAR_VERSION=" ` grep -m1 " <version>" pom.xml | cut -f2 -d" >" | cut -f1 -d " <" ` "
288251 docker build --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy --build-arg no_proxy=$no_proxy -t " ${IMAGE_NAME_OPERATOR} :${IMAGE_TAG_OPERATOR} " --build-arg VERSION=$JAR_VERSION --no-cache=true .
289252 docker tag " ${IMAGE_NAME_OPERATOR} :${IMAGE_TAG_OPERATOR} " weblogic-kubernetes-operator:latest
290-
291- if [ " $JRF_ENABLED " = false ] && [ " $IMAGE_TAG_WEBLOGIC " != " 12.2.1.4-slim" ]; then
292- get_wlthint3client_from_image
293- fi
253+
294254fi
0 commit comments