3
3
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
4
4
5
5
function clean_jenkins {
6
- echo " Cleaning."
7
- /usr/local/packages/aime/ias/run_as_root " ${PROJECT_ROOT} /src/integration-tests/bash/clean_docker_k8s.sh -y"
6
+ echo " Cleaning."
7
+ /usr/local/packages/aime/ias/run_as_root " ${PROJECT_ROOT} /src/integration-tests/bash/clean_docker_k8s.sh -y"
8
8
}
9
9
10
10
function setup_jenkins {
11
- echo " Setting up."
12
- /usr/local/packages/aime/ias/run_as_root " sh ${PROJECT_ROOT} /src/integration-tests/bash/install_docker_k8s.sh -y -u wls -v ${K8S_VERSION} "
13
- set +x
14
- . ~ /.dockerk8senv
15
- set -x
16
- id
17
-
18
- docker login -u
[email protected] -p
$docker_pass wlsldi-v2.docker.oraclecorp.com
19
- docker images
20
-
21
- pull_tag_images
22
-
23
- export JAR_VERSION=" ` grep -m1 " <version>" pom.xml | cut -f2 -d" >" | cut -f1 -d " <" ` "
24
- # create a docker image for the operator code being tested
25
- 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 .
26
- docker tag " ${IMAGE_NAME_OPERATOR} :${IMAGE_TAG_OPERATOR} " wlsldi-v2.docker.oraclecorp.com/weblogic-operator:latest
27
-
28
- docker images
11
+ echo " Setting up."
12
+ /usr/local/packages/aime/ias/run_as_root " sh ${PROJECT_ROOT} /src/integration-tests/bash/install_docker_k8s.sh -y -u wls -v ${K8S_VERSION} "
13
+ set +x
14
+ . ~ /.dockerk8senv
15
+ set -x
16
+ id
17
+
18
+ docker login -u
[email protected] -p
$docker_pass wlsldi-v2.docker.oraclecorp.com
19
+ docker images
20
+
21
+ pull_tag_images
22
+
23
+ export JAR_VERSION=" ` grep -m1 " <version>" pom.xml | cut -f2 -d" >" | cut -f1 -d " <" ` "
24
+ # create a docker image for the operator code being tested
25
+ 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 .
26
+ docker tag " ${IMAGE_NAME_OPERATOR} :${IMAGE_TAG_OPERATOR} " wlsldi-v2.docker.oraclecorp.com/weblogic-operator:latest
27
+
28
+ docker images
29
29
30
- echo " Helm installation starts"
31
- wget -q -O /tmp/helm-v2.8.2-linux-amd64.tar.gz https://kubernetes-helm.storage.googleapis.com/helm-v2.8.2-linux-amd64.tar.gz
32
- mkdir /tmp/helm
33
- tar xzf /tmp/helm-v2.8.2-linux-amd64.tar.gz -C /tmp/helm
34
- chmod +x /tmp/helm/linux-amd64/helm
35
- /usr/local/packages/aime/ias/run_as_root " cp /tmp/helm/linux-amd64/helm /usr/bin/"
36
- rm -rf /tmp/helm
37
- helm init
38
- echo " Helm is configured."
30
+ echo " Helm installation starts"
31
+ wget -q -O /tmp/helm-v2.8.2-linux-amd64.tar.gz https://kubernetes-helm.storage.googleapis.com/helm-v2.8.2-linux-amd64.tar.gz
32
+ mkdir /tmp/helm
33
+ tar xzf /tmp/helm-v2.8.2-linux-amd64.tar.gz -C /tmp/helm
34
+ chmod +x /tmp/helm/linux-amd64/helm
35
+ /usr/local/packages/aime/ias/run_as_root " cp /tmp/helm/linux-amd64/helm /usr/bin/"
36
+ rm -rf /tmp/helm
37
+ helm init
38
+ echo " Helm is configured."
39
39
}
40
40
41
41
function setup_wercker {
42
- echo " Perform setup for running in wercker"
43
- echo " Install tiller"
44
- kubectl create serviceaccount --namespace kube-system tiller
45
- kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
46
-
47
- # Note: helm init --wait would wait until tiller is ready, and requires helm 2.8.2 or above
48
- helm init --service-account=tiller --wait
49
-
50
- helm version
51
-
52
- kubectl get po -n kube-system
53
-
54
- echo " Existing helm charts "
55
- helm ls
56
- echo " Deleting installed helm charts"
57
- helm list --short | xargs -L1 helm delete --purge
58
- echo " After helm delete, list of installed helm charts is: "
59
- helm ls
60
-
61
- echo " Completed setup_wercker"
42
+ echo " Perform setup for running in wercker"
43
+ echo " Install tiller"
44
+ kubectl create serviceaccount --namespace kube-system tiller
45
+ kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
46
+
47
+ # Note: helm init --wait would wait until tiller is ready, and requires helm 2.8.2 or above
48
+ helm init --service-account=tiller --wait
49
+
50
+ helm version
51
+
52
+ kubectl get po -n kube-system
53
+
54
+ echo " Existing helm charts "
55
+ helm ls
56
+ echo " Deleting installed helm charts"
57
+ helm list --short | xargs -L1 helm delete --purge
58
+ echo " After helm delete, list of installed helm charts is: "
59
+ helm ls
60
+
61
+ echo " Completed setup_wercker"
62
62
}
63
63
64
64
function pull_tag_images {
65
+ echo " Pull and tag the images we need"
65
66
66
- echo " Pull and tag the images we need"
67
- docker pull wlsldi-v2.docker.oraclecorp.com/store-weblogic-12.2.1.3:latest
68
- docker tag wlsldi-v2.docker.oraclecorp.com/store-weblogic-12.2.1.3:latest store/oracle/weblogic:12.2.1.3
69
-
70
- docker pull wlsldi-v2.docker.oraclecorp.com/weblogic:19.1.0.0
71
- docker tag wlsldi-v2.docker.oraclecorp.com/weblogic:19.1.0.0 store/oracle/weblogic:19.1.0.0
67
+ docker pull wlsldi-v2.docker.oraclecorp.com/store-weblogic-12.2.1.3:latest
68
+ docker tag wlsldi-v2.docker.oraclecorp.com/store-weblogic-12.2.1.3:latest store/oracle/weblogic:12.2.1.3
72
69
73
- docker pull wlsldi-v2.docker.oraclecorp.com/store-serverjre-8:latest
74
- docker tag wlsldi-v2.docker.oraclecorp.com/store-serverjre-8:latest store/oracle/serverjre:8
70
+ docker pull wlsldi-v2.docker.oraclecorp.com/weblogic:19.1.0.0
71
+ docker tag wlsldi-v2.docker.oraclecorp.com/weblogic:19.1.0.0 store/oracle/weblogic:19.1.0.0
75
72
76
- docker pull wlsldi-v2.docker.oraclecorp.com/weblogic-webtier-apache-12.2.1.3.0 :latest
77
- docker tag wlsldi-v2.docker.oraclecorp.com/weblogic-webtier-apache-12.2.1.3.0 :latest store/oracle/apache:12.2.1.3
73
+ docker pull wlsldi-v2.docker.oraclecorp.com/store-serverjre-8 :latest
74
+ docker tag wlsldi-v2.docker.oraclecorp.com/store-serverjre-8 :latest store/oracle/serverjre:8
78
75
76
+ docker pull wlsldi-v2.docker.oraclecorp.com/weblogic-webtier-apache-12.2.1.3.0:latest
77
+ docker tag wlsldi-v2.docker.oraclecorp.com/weblogic-webtier-apache-12.2.1.3.0:latest store/oracle/apache:12.2.1.3
79
78
}
80
79
81
80
82
81
function create_image_pull_secret_jenkins {
83
-
84
- echo " Creating Secret"
85
- kubectl create secret docker-registry wlsldi-secret \
82
+ echo " Creating Secret"
83
+ kubectl create secret docker-registry wlsldi-secret \
86
84
--docker-server=wlsldi-v2.docker.oraclecorp.com \
87
85
88
86
--docker-password=$docker_pass \
89
87
90
88
91
- echo " Checking Secret"
92
- local SECRET=" ` kubectl get secret wlsldi-secret | grep wlsldi | wc | awk ' { print $1; }' ` "
93
- if [ " $SECRET " != " 1" ]; then
94
- echo ' secret wlsldi-secret was not created successfully'
95
- exit 1
96
- fi
97
-
89
+ echo " Checking Secret"
90
+ local SECRET=" ` kubectl get secret wlsldi-secret | grep wlsldi | wc | awk ' { print $1; }' ` "
91
+ if [ " $SECRET " != " 1" ]; then
92
+ echo ' secret wlsldi-secret was not created successfully'
93
+ exit 1
94
+ fi
98
95
}
99
96
100
97
export SCRIPTPATH=" $( cd " $( dirname " $0 " ) " > /dev/null 2>&1 ; pwd -P ) "
@@ -103,21 +100,23 @@ export RESULT_ROOT=${RESULT_ROOT:-/scratch/$USER/wl_k8s_test_results}
103
100
export PV_ROOT=${PV_ROOT:- $RESULT_ROOT }
104
101
echo " RESULT_ROOT$RESULT_ROOT PV_ROOT$PV_ROOT "
105
102
export BRANCH_NAME=" ${BRANCH_NAME:- $WERCKER_GIT_BRANCH } "
103
+ export IMAGE_NAME_WEBLOGIC=" ${IMAGE_NAME_WEBLOGIC:- store/ oracle/ weblogic} "
104
+ export IMAGE_TAG_WEBLOGIC=" ${IMAGE_TAG_WEBLOGIC:- 19.1.0.0} "
106
105
107
106
if [ -z " $BRANCH_NAME " ]; then
108
107
export BRANCH_NAME=" ` git branch | grep \* | cut -d ' ' -f2-` "
109
108
if [ ! " $? " = " 0" ] ; then
110
- echo " Error: Could not determine branch. Run script from within a git repo" .
111
- exit 1
109
+ echo " Error: Could not determine branch. Run script from within a git repo" .
110
+ exit 1
112
111
fi
113
112
fi
114
113
export IMAGE_TAG_OPERATOR=${IMAGE_TAG_OPERATOR:- `echo " test_${BRANCH_NAME} " | sed " s#/#_#g" `}
115
114
export IMAGE_NAME_OPERATOR=${IMAGE_NAME_OPERATOR:- wlsldi-v2.docker.oraclecorp.com/ weblogic-operator}
116
115
117
116
cd $PROJECT_ROOT
118
117
if [ $? -ne 0 ]; then
119
- echo " Couldn't change to $PROJECT_ROOT dir"
120
- exit 1
118
+ echo " Couldn't change to $PROJECT_ROOT dir"
119
+ exit 1
121
120
fi
122
121
123
122
export JAR_VERSION=" ` grep -m1 " <version>" pom.xml | cut -f2 -d" >" | cut -f1 -d " <" ` "
@@ -126,40 +125,40 @@ echo IMAGE_NAME_OPERATOR $IMAGE_NAME_OPERATOR IMAGE_TAG_OPERATOR $IMAGE_TAG_OPER
126
125
127
126
if [ " $WERCKER " = " true" ]; then
128
127
129
- echo " Test Suite is running locally on Wercker and k8s is running on remote nodes."
128
+ echo " Test Suite is running locally on Wercker and k8s is running on remote nodes."
130
129
131
- export IMAGE_PULL_SECRET_OPERATOR=$IMAGE_PULL_SECRET_OPERATOR
132
- export IMAGE_PULL_SECRET_WEBLOGIC=$IMAGE_PULL_SECRET_WEBLOGIC
130
+ export IMAGE_PULL_SECRET_OPERATOR=$IMAGE_PULL_SECRET_OPERATOR
131
+ export IMAGE_PULL_SECRET_WEBLOGIC=$IMAGE_PULL_SECRET_WEBLOGIC
133
132
134
- echo " Creating Docker Secret"
135
- kubectl create secret docker-registry $IMAGE_PULL_SECRET_WEBLOGIC \
133
+ echo " Creating Docker Secret"
134
+ kubectl create secret docker-registry $IMAGE_PULL_SECRET_WEBLOGIC \
136
135
--docker-server=index.docker.io/v1/ \
137
136
--docker-username=$DOCKER_USERNAME \
138
137
--docker-password=$DOCKER_PASSWORD \
139
138
--docker-email=$DOCKER_EMAIL
140
139
141
- echo " Checking Secret"
142
- SECRET=" ` kubectl get secret $IMAGE_PULL_SECRET_WEBLOGIC | grep $IMAGE_PULL_SECRET_WEBLOGIC | wc | awk ' { print $1; }' ` "
143
- if [ " $SECRET " != " 1" ]; then
144
- echo " secret $IMAGE_PULL_SECRET_WEBLOGIC was not created successfully"
145
- exit 1
146
- fi
140
+ echo " Checking Secret"
141
+ SECRET=" ` kubectl get secret $IMAGE_PULL_SECRET_WEBLOGIC | grep $IMAGE_PULL_SECRET_WEBLOGIC | wc | awk ' { print $1; }' ` "
142
+ if [ " $SECRET " != " 1" ]; then
143
+ echo " secret $IMAGE_PULL_SECRET_WEBLOGIC was not created successfully"
144
+ exit 1
145
+ fi
147
146
148
- echo " Creating Registry Secret"
149
- kubectl create secret docker-registry $IMAGE_PULL_SECRET_OPERATOR \
147
+ echo " Creating Registry Secret"
148
+ kubectl create secret docker-registry $IMAGE_PULL_SECRET_OPERATOR \
150
149
--docker-server=$REPO_REGISTRY \
151
150
--docker-username=$REPO_USERNAME \
152
151
--docker-password=$REPO_PASSWORD \
153
152
--docker-email=$REPO_EMAIL
154
153
155
- echo " Checking Secret"
156
- SECRET=" ` kubectl get secret $IMAGE_PULL_SECRET_OPERATOR | grep $IMAGE_PULL_SECRET_OPERATOR | wc | awk ' { print $1; }' ` "
157
- if [ " $SECRET " != " 1" ]; then
158
- echo " secret $IMAGE_PULL_SECRET_OPERATOR was not created successfully"
159
- exit 1
160
- fi
161
-
162
- setup_wercker
154
+ echo " Checking Secret"
155
+ SECRET=" ` kubectl get secret $IMAGE_PULL_SECRET_OPERATOR | grep $IMAGE_PULL_SECRET_OPERATOR | wc | awk ' { print $1; }' ` "
156
+ if [ " $SECRET " != " 1" ]; then
157
+ echo " secret $IMAGE_PULL_SECRET_OPERATOR was not created successfully"
158
+ exit 1
159
+ fi
160
+
161
+ setup_wercker
163
162
164
163
elif [ " $JENKINS " = " true" ]; then
165
164
@@ -194,18 +193,14 @@ elif [ "$JENKINS" = "true" ]; then
194
193
/usr/local/packages/aime/ias/run_as_root " mkdir -p $PV_ROOT /acceptance_test_pv_archive"
195
194
/usr/local/packages/aime/ias/run_as_root " chmod 777 $PV_ROOT /acceptance_test_pv_archive"
196
195
197
-
198
-
199
196
else
200
- pull_tag_images
201
-
202
- # docker rmi -f $(docker images -q -f dangling=true)
203
- docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi -f
204
-
205
- docker images
197
+ pull_tag_images
198
+
199
+ # docker rmi -f $(docker images -q -f dangling=true)
200
+ docker images --quiet --filter=dangling=true | xargs --no-run-if-empty docker rmi -f
201
+
202
+ docker images
206
203
207
204
export JAR_VERSION=" ` grep -m1 " <version>" pom.xml | cut -f2 -d" >" | cut -f1 -d " <" ` "
208
- 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 .
209
-
205
+ 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 .
210
206
fi
211
-
0 commit comments