File tree Expand file tree Collapse file tree 3 files changed +173
-82
lines changed
src/integration-tests/bash Expand file tree Collapse file tree 3 files changed +173
-82
lines changed Original file line number Diff line number Diff line change @@ -24,20 +24,23 @@ function fail {
2424function archive {
2525 local SOURCE_DIR=" ${1?} "
2626 local ARCHIVE_DIR=" ${2?} "
27- local ARCHIVE=" $ARCHIVE_DIR /IntSuite.` date ' +%Y%m%d%H%M%S' ` .tar.gz"
27+ local ARCHIVE_FILE=" IntSuite.` date ' +%Y%m%d%H%M%S' ` .tar.gz"
28+ local ARCHIVE=" $ARCHIVE_DIR /$ARCHIVE_FILE "
29+ local OUTFILE=" /tmp/$ARCHIVE_FILE "
2830
29- trace About to archive a copy of \' $SOURCE_DIR \' to \' $ARCHIVE \' .
31+ trace About to archive \' $SOURCE_DIR \' .
3032
3133 [ ! -d " $SOURCE_DIR " ] && fail Could not archive, could not find source directory \' $SOURCE_DIR \' .
3234
3335 mkdir -p $ARCHIVE_DIR || fail Could not archive, could not create target directory \' $ARCHIVE_DIR \' .
3436
35- tar -czf $ARCHIVE $SOURCE_DIR 2>&1
36- [ $? -eq 0 ] || fail " Could not archive, 'tar -czf $ARCHIVE $SOURCE_DIR ' command failed."
37+ tar -czf $ARCHIVE $SOURCE_DIR > $OUTFILE 2>&1
38+ [ $? -eq 0 ] || fail " Could not archive, 'tar -czf $ARCHIVE $SOURCE_DIR ' command failed: ` cat $OUTFILE ` "
39+ rm -f $OUTFILE
3740
3841 find $ARCHIVE_DIR -maxdepth 1 -name " IntSuite*tar.gz" | sort -r | awk ' { if (NR>5) print $NF }' | xargs rm -f
3942
40- trace Archived copy of \' $SOURCE_DIR \' to \' $ARCHIVE \' .
43+ trace Archived to \' $ARCHIVE \' .
4144}
4245
4346archive " $1 " " $2 "
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ JOB_NAME="weblogic-command-job"
2626
2727# Customizable env vars. See run.sh for an explanation.
2828
29- echo " @@ Begin command job. Job name='$JOB_NAME '. Command='$* '."
29+ echo " @@ Begin kubernetes job to run a command . Job name='$JOB_NAME '. Command='$* '."
3030
3131echo " @@ At script entry: RESULT_ROOT='$RESULT_ROOT '"
3232echo " @@ At script entry: PV_ROOT='$PV_ROOT '"
@@ -103,15 +103,7 @@ function launchCommandJob {
103103 break
104104 fi
105105
106- local pods=$( kubectl get pods --show-all --selector=job-name=$JOB_NAME --output=jsonpath={.items..metadata.name})
107- local pod_status=" unknown"
108- local pod
109- for pod in $pods ; do
110- pod_status=` kubectl get pods --show-all --selector=job-name=$JOB_NAME | grep " $JOB_NAME " | awk ' { print $3 }' `
111- if [ " $pod_status " = " Completed" -o " $pod_status " = " Error" -o " $pod_status " = " ErrImagePull" ]; then
112- break
113- fi
114- done
106+ local pod_status=` kubectl get pods --show-all --selector=job-name=$JOB_NAME | grep " $JOB_NAME " | awk ' { print $3 }' `
115107
116108 if [ " $pod_status " = " Completed" ]; then
117109 echo " @@ Success. job_status=$job_status pod_status=$pod_status "
@@ -140,10 +132,10 @@ function launchCommandJob {
140132 for pod in $pods ; do
141133 echo @@
142134 echo " @@ Calling 'kubectl get pod $pod '"
143- kubectl get pod $pod 2>&1
135+ kubectl get pod $pod 2>&1
144136 echo @@
145137 echo " @@ Calling 'kubectl logs pod $pod '"
146- kubectl logs $pod 2>&1
138+ kubectl logs $pod 2>&1
147139 echo @@
148140 done
149141
You can’t perform that action at this time.
0 commit comments