Skip to content

Commit cab702a

Browse files
committed
remove setupjrfenv.sh
1 parent 3774d79 commit cab702a

File tree

3 files changed

+89
-259
lines changed

3 files changed

+89
-259
lines changed

integration-tests/pom.xml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,14 +221,17 @@
221221
</configuration>
222222
</execution>
223223
<execution>
224-
<id>${setupenvid}</id>
224+
<id>setupenv</id>
225225
<phase>pre-integration-test</phase>
226226
<goals>
227227
<goal>exec</goal>
228228
</goals>
229229
<configuration>
230+
<environmentVariables>
231+
<JRF_ENABLED>${jrf_enabled}</JRF_ENABLED>
232+
</environmentVariables>
230233
<skip>${skipITs}</skip>
231-
<executable>${resource-integration-test}/${setupenvid}.sh</executable>
234+
<executable>${resource-integration-test}/setupenv.sh</executable>
232235
</configuration>
233236
</execution>
234237
</executions>
@@ -320,16 +323,16 @@
320323
<id>java-integration-tests</id>
321324
<properties>
322325
<skipITs>false</skipITs>
323-
<setupenvid>setupenv</setupenvid>
324326
<includes-failsafe>**/IT*</includes-failsafe>
327+
<jrf_enabled>false</jrf_enabled>
325328
</properties>
326329
</profile>
327330
<profile>
328331
<id>jrf-integration-tests</id>
329332
<properties>
330333
<skipITs>false</skipITs>
331-
<setupenvid>setupjrfenv</setupenvid>
332334
<includes-failsafe>**/JrfInOperatorTest.java</includes-failsafe>
335+
<jrf_enabled>true</jrf_enabled>
333336
</properties>
334337
</profile>
335338
<profile>
@@ -341,6 +344,7 @@
341344
<surefireArgLine></surefireArgLine>
342345
<failsafeArgLine></failsafeArgLine>
343346
<skipITs>true</skipITs>
347+
<jrf_enabled>false</jrf_enabled>
344348
</properties>
345349
</profile>
346350
</profiles>

integration-tests/src/test/resources/setupenv.sh

Lines changed: 81 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,32 @@ function setup_wercker {
6363
function pull_tag_images {
6464

6565
export IMAGE_PULL_SECRET_WEBLOGIC="${IMAGE_PULL_SECRET_WEBLOGIC:-docker-store}"
66+
6667
set +x
6768
if [ -z "$DOCKER_USERNAME" ] || [ -z "$DOCKER_PASSWORD" ] || [ -z "$DOCKER_EMAIL" ]; then
68-
if [ -z $(docker images -q $IMAGE_NAME_WEBLOGIC:$IMAGE_TAG_WEBLOGIC) ]; then
69-
echo "Image $IMAGE_NAME_WEBLOGIC:$IMAGE_TAG_WEBLOGIC doesn't exist. Provide Docker login details using env variables DOCKER_USERNAME, DOCKER_PASSWORD and DOCKER_EMAIL to pull the image."
70-
exit 1
69+
# check the oracle db image exists if use jrf domain
70+
if [ "$JRF_ENABLED" = true ] ; then
71+
if [ -z $(docker images -q $IMAGE_NAME_ORACLEDB:$IMAGE_TAG_ORACLEDB) ]; then
72+
echo "Image $IMAGE_NAME_ORACLEDB:$IMAGE_TAG_ORACLEDB doesn't exist. Provide Docker login details using env variables DOCKER_USERNAME, DOCKER_PASSWORD and DOCKER_EMAIL to pull the image."
73+
exit 1
74+
fi
75+
else
76+
if [ -z $(docker images -q $IMAGE_NAME_WEBLOGIC:$IMAGE_TAG_WEBLOGIC) ]; then
77+
echo "Image $IMAGE_NAME_WEBLOGIC:$IMAGE_TAG_WEBLOGIC doesn't exist. Provide Docker login details using env variables DOCKER_USERNAME, DOCKER_PASSWORD and DOCKER_EMAIL to pull the image."
78+
exit 1
79+
fi
7180
fi
7281
fi
73-
82+
83+
if [ "$JRF_ENABLED" = true ] ; then
84+
if [ -z "$OCIR_REPO_USERNAME" ] || [ -z "$OCIR_REPO_PASSWORD" ] || [ -z "$OCIR_REPO_EMAIL" ]; then
85+
if [ -z $(docker images -q $IMAGE_NAME_WEBLOGIC:$IMAGE_TAG_WEBLOGIC) ]; then
86+
echo "Image $IMAGE_NAME_WEBLOGIC:$IMAGE_TAG_WEBLOGIC doesn't exist. Provide Docker login details using env variables OCIR_REPO_USERNAME, OCIR_REPO_PASSWORD and OCIR_REPO_EMAIL to pull the image."
87+
exit 1
88+
fi
89+
fi
90+
fi
91+
7492
if [ -n "$DOCKER_USERNAME" ] && [ -n "$DOCKER_PASSWORD" ] && [ -n "$DOCKER_EMAIL" ]; then
7593
echo "Creating Docker Secret"
7694

@@ -88,8 +106,37 @@ function pull_tag_images {
88106
fi
89107
# below docker pull is needed to get wlthint3client.jar from image to put in the classpath
90108
docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
91-
docker pull $IMAGE_NAME_WEBLOGIC:$IMAGE_TAG_WEBLOGIC
109+
if [ "$JRF_ENABLED" = true ] ; then
110+
docker pull $IMAGE_NAME_ORACLEDB:$IMAGE_TAG_ORACLEDB
111+
else
112+
docker pull $IMAGE_NAME_WEBLOGIC:$IMAGE_TAG_WEBLOGIC
113+
fi
92114
fi
115+
116+
if [ "$JRF_ENABLED" = true ] ; then
117+
export IMAGE_PULL_SECRET_FMWINFRA="${IMAGE_PULL_SECRET_FMWINFRA:-ocir-store}"
118+
119+
if [ -n "$OCIR_REPO_USERNAME" ] && [ -n "$OCIR_REPO_PASSWORD" ] && [ -n "$OCIR_REPO_EMAIL" ]; then
120+
echo "Creating Docker Secret"
121+
122+
kubectl create secret docker-registry $IMAGE_PULL_SECRET_FMWINFRA \
123+
--docker-server=phx.ocir.io \
124+
--docker-username=$OCIR_REPO_USERNAME \
125+
--docker-password=$OCIR_REPO_PASSWORD \
126+
--docker-email=$OCIR_REPO_EMAIL
127+
128+
echo "Checking Secret"
129+
SECRET="`kubectl get secret $IMAGE_PULL_SECRET_FMWINFRA | grep $IMAGE_PULL_SECRET_FMWINFRA | wc | awk ' { print $1; }'`"
130+
if [ "$SECRET" != "1" ]; then
131+
echo "secret $IMAGE_PULL_SECRET_FMWINFRA was not created successfully"
132+
exit 1
133+
fi
134+
# below docker pull is needed to get wlthint3client.jar from image to put in the classpath
135+
docker login phx.ocir.io -u $OCIR_REPO_USERNAME -p $OCIR_REPO_PASSWORD
136+
docker pull $IMAGE_NAME_WEBLOGIC:$IMAGE_TAG_WEBLOGIC
137+
fi
138+
fi
139+
93140
set -x
94141

95142
}
@@ -100,15 +147,23 @@ function get_wlthint3client_from_image {
100147
docker cp $id:/u01/oracle/wlserver/server/lib/wlthint3client.jar $SCRIPTPATH
101148
docker rm -v $id
102149
}
150+
103151
export SCRIPTPATH="$( cd "$(dirname "$0")" > /dev/null 2>&1 ; pwd -P )"
104152
export PROJECT_ROOT="$SCRIPTPATH/../../../.."
105153
export RESULT_ROOT=${RESULT_ROOT:-/scratch/$USER/wl_k8s_test_results}
106154
export PV_ROOT=${PV_ROOT:-$RESULT_ROOT}
107155
echo "RESULT_ROOT$RESULT_ROOT PV_ROOT$PV_ROOT"
108156
export BRANCH_NAME="${BRANCH_NAME:-$WERCKER_GIT_BRANCH}"
109-
export IMAGE_NAME_WEBLOGIC="${IMAGE_NAME_WEBLOGIC:-store/oracle/weblogic}"
157+
158+
if [ "$JRF_ENABLED" = true ] ; then
159+
export IMAGE_NAME_WEBLOGIC="${IMAGE_NAME_WEBLOGIC:-phx.ocir.io/weblogick8s/oracle/fmw-infrastructure}"
160+
export IMAGE_NAME_ORACLEDB="${IMAGE_NAME_ORACLEDB:-store/oracle/database-enterprise}"
161+
export IMAGE_TAG_ORACLEDB="${IMAGE_TAG_ORACLEDB:-12.2.0.1}"
162+
else
163+
export IMAGE_NAME_WEBLOGIC="${IMAGE_NAME_WEBLOGIC:-store/oracle/weblogic}"
164+
fi
110165
export IMAGE_TAG_WEBLOGIC="${IMAGE_TAG_WEBLOGIC:-12.2.1.3}"
111-
166+
112167
if [ -z "$BRANCH_NAME" ]; then
113168
export BRANCH_NAME="`git branch | grep \* | cut -d ' ' -f2-`"
114169
if [ ! "$?" = "0" ] ; then
@@ -163,7 +218,25 @@ if [ "$WERCKER" = "true" ]; then
163218
echo "secret $IMAGE_PULL_SECRET_OPERATOR was not created successfully"
164219
exit 1
165220
fi
166-
221+
222+
if [ "$JRF_ENABLED" = true ] ; then
223+
export IMAGE_PULL_SECRET_FMWINFRA="${IMAGE_PULL_SECRET_FMWINFRA:-ocir-store}"
224+
225+
echo "Creating Docker Secret"
226+
kubectl create secret docker-registry $IMAGE_PULL_SECRET_FMWINFRA \
227+
--docker-server=phx.ocir.io \
228+
--docker-username=$OCIR_REPO_USERNAME \
229+
--docker-password=$OCIR_REPO_PASSWORD \
230+
--docker-email=$OCIR_REPO_EMAIL
231+
232+
echo "Checking Secret"
233+
SECRET="`kubectl get secret $IMAGE_PULL_SECRET_FMWINFRA | grep $IMAGE_PULL_SECRET_FMWINFRA | wc | awk ' { print $1; }'`"
234+
if [ "$SECRET" != "1" ]; then
235+
echo "secret $IMAGE_PULL_SECRET_FMWINFRA was not created successfully"
236+
exit 1
237+
fi
238+
fi
239+
167240
setup_wercker
168241

169242
elif [ "$JENKINS" = "true" ]; then

0 commit comments

Comments
 (0)