Skip to content

Commit fbebb33

Browse files
committed
using phx serverjre for wercker
1 parent e708a78 commit fbebb33

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ function state_dump {
6969
# use a run to archive PV, /sharedparent mounts to PV_ROOT in the K8S cluster
7070
echo "Archiving pv directory using a kubernetes run. Look for it on k8s cluster in $PV_ROOT/acceptance_test_pv_archive"
7171
local outfile=${DUMP_DIR}/archive_pv_run.out
72-
$SCRIPTPATH/krun.sh -m "${PV_ROOT}:/sharedparent" -c 'jar cf /sharedparent/pvarchive.jar /sharedparent/acceptance_test_pv' 2>&1 | tee ${outfile}
72+
$SCRIPTPATH/krun.sh -t 300 -d ${RESULT_ROOT} -m "${PV_ROOT}:/sharedparent" -c 'jar cf /sharedparent/pvarchive.jar /sharedparent/acceptance_test_pv' 2>&1 | tee ${outfile}
7373
if [ "$?" = "0" ]; then
7474
id
75-
$SCRIPTPATH/krun.sh -m "${PV_ROOT}:/sharedparent" -c 'base64 /sharedparent/pvarchive.jar' > $RESULT_ROOT/pvarchive.b64 2>&1
75+
$SCRIPTPATH/krun.sh -t 300 -d ${RESULT_ROOT} -m "${PV_ROOT}:/sharedparent" -c 'base64 /sharedparent/pvarchive.jar' > $RESULT_ROOT/pvarchive.b64 2>&1
7676
if [ "$?" = "0" ]; then
7777
base64 -di $RESULT_ROOT/pvarchive.b64 > $ARCHIVE
7878
if [ "$?" = "0" ]; then

src/integration-tests/bash/cleanup.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ USER_PROJECTS_DIR="$RESULT_DIR/user-projects"
6161
TMP_DIR="$RESULT_DIR/cleanup_tmp"
6262
JOB_NAME="weblogic-command-job"
6363

64+
6465
function fail {
6566
echo @@ cleanup.sh: Error "$@"
6667
exit 1
@@ -350,7 +351,11 @@ if [ "${DELETE_FILES:-true}" = "true" ]; then
350351

351352
echo @@ Launching run to delete all pv contents. This runs in the k8s cluster, /sharedparent mounts PV_ROOT.
352353
# $SCRIPTPATH/job.sh "rm -fr /scratch/acceptance_test_pv"
353-
$SCRIPTPATH/krun.sh -i store/oracle/weblogic:12.2.1.3 -m "${PV_ROOT}:/sharedparent" -c 'rm -fr /sharedparent/acceptance_test_pv'
354+
if [ "$WERCKER" = "true" ]; then
355+
$SCRIPTPATH/krun.sh -i phx.ocir.io/weblogick8s/serverjre:8 -m "${PV_ROOT}:/sharedparent" -c 'rm -fr /sharedparent/acceptance_test_pv'
356+
else
357+
$SCRIPTPATH/krun.sh -m "${PV_ROOT}:/sharedparent" -c 'rm -fr /sharedparent/acceptance_test_pv'
358+
fi
354359
[ "$?" = "0" ] || SUCCESS="1"
355360
echo @@ SUCCESS=$SUCCESS
356361

src/integration-tests/bash/krun.sh

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,33 +30,40 @@ VCOMMA=''
3030
CMFILES=''
3131
VOLUMECOUNT=0
3232

33+
TMPDIR='/tmp'
34+
3335
EXITCODE=0
3436

3537
usage_exit() {
3638
cat << EOF
3739
38-
Usage: $(basename $0) [-i image] [-n namespace] [-c command]
39-
[-m pvc-name:mount-path]
40-
[-f local-file-name]
41-
[-t timeout]
40+
Usage: $(basename $0) ...options...
4241
43-
Run a 'one-off' command on a kubernetes cluster via a temporary pod,
44-
optionally specify pvc mounts and additional files to load.
42+
Runs a 'one-off' command on a kubernetes cluster via a temporary pod.
43+
Provides options to specify pvc mounts, hostpath mounts, or additional
44+
files to load.
4545
4646
Parameters:
4747
4848
-i imagename - Image, default is "$IMAGE".
4949
-l imagepullpolicy - Image pull policy, default is "$IMAGEPULLPOLICY".
5050
-s imagesecret - Image pull secret. No default.
51+
5152
-n namespace - Namespace, default is "$NAMESPACE".
5253
-p podname - Pod name, default is "$PODNAME".
54+
5355
-c command - Command, default is "$COMMAND".
54-
-t timeout - Timeout in seconds, default is $MAXSECS seconds.
56+
5557
-m pvc-name:mount-path - PVC name and mount location. No default.
5658
-m host-path:mount-path- Remote host-path and mount location. No default.
5759
Host-path must begin with a '/'.
5860
-f /path/filename - Copies local file to pod at /tmpmount/filename
5961
62+
-t timeout - Timeout in seconds, default is $MAXSECS seconds.
63+
64+
-d tmpdir - Location to put tmp file(s). Default is "$TMPDIR".
65+
Use this if your command's output might be large.
66+
6067
You can specify -f, -m, and -s more than once.
6168
6269
Limitation:
@@ -103,7 +110,7 @@ delete_pod_and_cm() {
103110
kubectl delete -n ${NAMESPACE} cm ${PODNAME}-cm --ignore-not-found > /dev/null 2>&1
104111
}
105112

106-
while getopts m:t:i:c:n:f:p: OPT
113+
while getopts m:t:i:c:n:f:p:l:s:d: OPT
107114
do
108115
case $OPT in
109116
i) IMAGE=$OPTARG
@@ -121,6 +128,8 @@ do
121128
;;
122129
t) MAXSECS=$OPTARG
123130
;;
131+
d) TMPDIR=$OPTARG
132+
;;
124133
f) # local file to make available in /tmpmount
125134
if [ "$CMFILES" = "" ]; then
126135
VOL_MOUNTS="${VOL_MOUNTS}${VCOMMA}{\"name\": \"my-config-map-vol\",\"mountPath\": \"/tmpmount\"}"
@@ -161,7 +170,9 @@ shift $(($OPTIND - 1))
161170

162171
# setup a tmp file /tmp/[script-file-name].[name-space].[pod-name].tmp.[pid]
163172

164-
TEMPFILE="/tmp/$(basename $0).${NAMESPACE}.${PODNAME}.tmp.$$"
173+
[ ! -d "$TMPDIR" ] && echo "Error: temp dir \"$TMPDIR\" not found. Check parameters." && exit 1
174+
175+
TEMPFILE="${TMPDIR}/$(basename $0).${NAMESPACE}.${PODNAME}.tmp.$$"
165176

166177
# cleanup anything from previous run
167178

0 commit comments

Comments
 (0)