1- #! /bin/bash
1+ #! /usr/ bin/env bash
22set -euxo pipefail
33
4- export PATH=$WSTMP :$PATH
5- if [ \! -x $WSTMP /kind ]
4+ export PATH=$WORKSPACE_TMP :$PATH
5+ if [ \! -x " $WORKSPACE_TMP /kind" ]
66then
7- curl -sLo $WSTMP /kind https://github.com/kubernetes-sigs/kind/releases/download/v0.17.0/kind-$( uname | tr ' [:upper:]' ' [:lower:]' ) -amd64
8- chmod +x $WSTMP /kind
7+ curl -sLo " $WORKSPACE_TMP /kind" https://github.com/kubernetes-sigs/kind/releases/download/v0.17.0/kind-$( uname | tr ' [:upper:]' ' [:lower:]' ) -amd64
8+ chmod +x " $WORKSPACE_TMP /kind"
99fi
10- if [ \! -x $WSTMP /kubectl ]
10+ if [ \! -x " $WORKSPACE_TMP /kubectl" ]
1111then
12- curl -sLo $WSTMP /kubectl https://storage.googleapis.com/kubernetes-release/release/v1.25.4/bin/$( uname | tr ' [:upper:]' ' [:lower:]' ) /amd64/kubectl
13- chmod +x $WSTMP /kubectl
12+ curl -sLo " $WORKSPACE_TMP /kubectl" https://storage.googleapis.com/kubernetes-release/release/v1.25.4/bin/$( uname | tr ' [:upper:]' ' [:lower:]' ) /amd64/kubectl
13+ chmod +x " $WORKSPACE_TMP /kubectl"
1414fi
1515
1616export cluster=ci$RANDOM
17- export KUBECONFIG=$WSTMP /kubeconfig-$cluster
17+ export KUBECONFIG=" $WORKSPACE_TMP /kubeconfig-$cluster "
1818kind create cluster --name $cluster --wait 5m
1919function cleanup() {
20- kind export logs --name $cluster $WSTMP /kindlogs || :
20+ kind export logs --name $cluster " $WORKSPACE_TMP /kindlogs" || :
2121 kind delete cluster --name $cluster || :
22- rm $KUBECONFIG
22+ rm " $KUBECONFIG "
2323}
2424trap cleanup EXIT
2525kubectl cluster-info
@@ -29,10 +29,10 @@ PRE_LOAD_IMAGES+=($(grep -e image: test-in-k8s.yaml | cut -d ':' -f 2- | xargs))
2929PRE_LOAD_IMAGES+=($( grep -h --include=" *.groovy" -e " ^\s*image: .*$" -R src/test/resources | sed -e " s/^[[:space:]]*image: //" | sort | uniq | grep -v " windows" | grep -v " nonexistent" | grep -v " invalid" | xargs) )
3030for image in " ${PRE_LOAD_IMAGES[@]} "
3131do
32- docker pull $image
33- kind load docker-image $image --name $cluster
32+ docker pull " $image "
33+ kind load docker-image " $image " --name $cluster
3434done
3535
36- bash test-in-k8s.sh
37- rm -rf $WSTMP /surefire-reports
38- kubectl cp jenkins:/checkout/target/surefire-reports $WSTMP /surefire-reports
36+ test-in-k8s.sh " $@ "
37+ rm -rf " $WORKSPACE_TMP /surefire-reports"
38+ kubectl cp jenkins:/checkout/target/surefire-reports " $WORKSPACE_TMP /surefire-reports"
0 commit comments