@@ -46,14 +46,16 @@ build:
46
46
cp operator/target/weblogic-kubernetes-operator-1.0.jar /operator/weblogic-kubernetes-operator.jar
47
47
cp operator/target/lib/*.jar /operator/lib/
48
48
export IMAGE_TAG_OPERATOR="${IMAGE_TAG_OPERATOR:-${WERCKER_GIT_BRANCH//[_\/]/-}}"
49
- if [ "$IMAGE_TAG_OPERATOR" = "master " ]; then
49
+ if [ "$IMAGE_TAG_OPERATOR" = "develop " ]; then
50
50
export IMAGE_TAG_OPERATOR="latest"
51
+ elif [ "$IMAGE_TAG_OPERATOR" = "master" ]; then
52
+ export IMAGE_TAG_OPERATOR="1.0"
51
53
fi
52
54
- script :
53
55
name : Remove things we do not want in the Docker image in order to reduce size of image
54
56
code : |
55
- rpm -e --nodeps tar
56
- rpm -e --nodeps gzip
57
+ rpm -e --nodeps tar
58
+ rpm -e --nodeps gzip
57
59
yum clean all
58
60
rm -rf /var/cache/yum
59
61
# push the image to Docker using the GIT branch as the tag
@@ -85,14 +87,14 @@ integration-test:
85
87
# clean up
86
88
yum clean all
87
89
88
- # store the artifacts so we can download them easily
90
+ # store the artifacts so we can download them easily
89
91
tar czvf ${WERCKER_REPORT_ARTIFACTS_DIR}/integration-test-data.tar.gz /pipeline/output/*
90
92
}
91
-
93
+
92
94
function finish {
93
95
exit_code=$?
94
96
export INTEGRATION_TEST_RESULT="$exit_code"
95
-
97
+
96
98
cleanup_and_store
97
99
exit 0
98
100
}
@@ -160,7 +162,7 @@ integration-test:
160
162
echo @@ "LEASE_ID=$LEASE_ID host=$HOST date=`date` user=$USER."
161
163
echo @@
162
164
echo @@ "Current lease owner (if any):"
163
- $WERCKER_SOURCE_DIR/src/integration-tests/bash/lease.sh -s
165
+ $WERCKER_SOURCE_DIR/src/integration-tests/bash/lease.sh -s
164
166
echo @@
165
167
echo @@ "About to try obtain lease:"
166
168
$WERCKER_SOURCE_DIR/src/integration-tests/bash/lease.sh -o "$LEASE_ID" -t $((100 * 60))
@@ -175,8 +177,10 @@ integration-test:
175
177
176
178
export IMAGE_NAME_OPERATOR="${REPO_REPOSITORY}"
177
179
export IMAGE_TAG_OPERATOR="${WERCKER_GIT_BRANCH//[_\/]/-}"
178
- if [ "$IMAGE_TAG_OPERATOR" = "master " ]; then
180
+ if [ "$IMAGE_TAG_OPERATOR" = "develop " ]; then
179
181
export IMAGE_TAG_OPERATOR="latest"
182
+ elif [ "$IMAGE_TAG_OPERATOR" = "master" ]; then
183
+ export IMAGE_TAG_OPERATOR="1.0"
180
184
fi
181
185
export IMAGE_PULL_POLICY_OPERATOR="Always"
182
186
export IMAGE_PULL_SECRET_OPERATOR="ocir-registry"
@@ -189,24 +193,24 @@ integration-test:
189
193
$WERCKER_SOURCE_DIR/src/integration-tests/bash/run.sh
190
194
RUN_SH_RC=$?
191
195
192
- if [ "$RUN_SH_RC" = "0" ]; then
196
+ if [ "$RUN_SH_RC" = "0" ]; then
193
197
echo "run.sh finished successfully"
194
198
else
195
199
echo "run.sh failed with return code ${RUN_SH_RC}"
196
200
exit $RUN_SH_RC
197
201
fi
198
-
202
+
199
203
cleanup_and_store
200
204
201
205
# This pipeline runs java integration tests against a k8s cluster on OCI.
202
206
command-timeout : 60
203
207
integration-test-java :
204
208
steps :
205
209
- script :
206
- name : obtain lease on k8s cluster
210
+ name : obtain lease on k8s cluster
207
211
code : |
208
212
#!/bin/bash
209
-
213
+
210
214
cp /etc/hosts $WERCKER_PIPELINE_DIR/hosts
211
215
sed -i "$ a ${OCI_K8S_WORKER0_IP} ${OCI_K8S_WORKER0_HOSTNAME}" $WERCKER_PIPELINE_DIR/hosts
212
216
cp $WERCKER_PIPELINE_DIR/hosts /etc/hosts
@@ -258,7 +262,7 @@ integration-test-java:
258
262
echo @@ "LEASE_ID=$LEASE_ID host=$HOST date=`date` user=$USER."
259
263
echo @@
260
264
echo @@ "Current lease owner (if any):"
261
- $WERCKER_SOURCE_DIR/src/integration-tests/bash/lease.sh -s
265
+ $WERCKER_SOURCE_DIR/src/integration-tests/bash/lease.sh -s
262
266
echo @@
263
267
echo @@ "About to try obtain lease:"
264
268
$WERCKER_SOURCE_DIR/src/integration-tests/bash/lease.sh -o "$LEASE_ID" -t $((100 * 60))
@@ -273,26 +277,28 @@ integration-test-java:
273
277
274
278
export IMAGE_NAME_OPERATOR="${REPO_REPOSITORY}"
275
279
export IMAGE_TAG_OPERATOR="${WERCKER_GIT_BRANCH//[_\/]/-}"
276
- if [ "$IMAGE_TAG_OPERATOR" = "master " ]; then
280
+ if [ "$IMAGE_TAG_OPERATOR" = "develop " ]; then
277
281
export IMAGE_TAG_OPERATOR="latest"
282
+ elif [ "$IMAGE_TAG_OPERATOR" = "master" ]; then
283
+ export IMAGE_TAG_OPERATOR="1.0"
278
284
fi
279
285
export IMAGE_PULL_POLICY_OPERATOR="Always"
280
286
export IMAGE_PULL_SECRET_OPERATOR="ocir-registry"
281
287
export IMAGE_PULL_SECRET_WEBLOGIC="docker-store"
282
288
283
289
echo "Integration test suite against the test image which is:"
284
290
echo "$IMAGE_NAME_OPERATOR:$IMAGE_TAG_OPERATOR"
285
-
291
+
286
292
- script :
287
293
name : Install pre-reqs
288
294
code : |
289
295
yum -y install tar gzip procps
290
-
296
+
291
297
- wercker/maven :
292
298
goals : test-compile integration-test
293
299
version : 3.5.2
294
300
profiles : java-integration-tests
295
-
301
+
296
302
- script :
297
303
name : cleanup and store
298
304
code : |
@@ -301,28 +307,34 @@ integration-test-java:
301
307
# clean up
302
308
yum clean all
303
309
304
- # store the artifacts so we can download them easily
310
+ # store the artifacts so we can download them easily
305
311
tar czvf ${WERCKER_REPORT_ARTIFACTS_DIR}/integration-test-data.tar.gz /pipeline/output/*
306
312
}
307
-
313
+
308
314
cleanup_and_store
309
-
310
-
311
- # This pipeline runs quality checks
315
+
316
+ # This pipeline runs quality checks
312
317
quality :
313
318
steps :
314
319
- script :
315
320
name : Install pre-reqs
316
321
code : |
317
322
yum -y install tar gzip procps
318
- - wercker/maven :
319
- profiles : build-sonar
320
- maven_opts : -Dsonar.login=${SONAR_LOGIN} -Dsonar.password=${SONAR_PASSWORD} -Dsonar.host.url=${SONAR_HOST}
323
+ - wercker/maven :
324
+ profiles : build-sonar
325
+ maven_opts : -Dsonar.login=${SONAR_LOGIN} -Dsonar.password=${SONAR_PASSWORD} -Dsonar.host.url=${SONAR_HOST}
321
326
goals : clean install sonar:sonar
322
327
cache_repo : true
323
328
version : 3.5.2
324
329
330
+ promote-image :
331
+ steps :
332
+ - internal/docker-push :
333
+ username : $REPO_USERNAME
334
+ password : $REPO_PASSWORD
335
+ repository : oracle/weblogic-kubernetes-operator
336
+ tag : $IMAGE_TAG_OPERATOR
325
337
326
338
dev :
327
339
steps :
328
- - internal/shell
340
+ - internal/shell
0 commit comments