Skip to content

Commit c1e5609

Browse files
authored
Merge pull request #655 from mattcary/add-ci
Add run-k8s-integration-ci.sh
2 parents fb027cc + f129e22 commit c1e5609

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

test/run-k8s-integration-ci.sh

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# Optional environment variables
4+
# GCE_PD_OVERLAY_NAME: which Kustomize overlay to deploy with
5+
# GCE_PD_DO_DRIVER_BUILD: if set, don't build the driver from source and just
6+
# use the driver version from the overlay
7+
# GCE_PD_BOSKOS_RESOURCE_TYPE: name of the boskos resource type to reserve
8+
9+
set -o nounset
10+
set -o errexit
11+
12+
readonly PKGDIR=${GOPATH}/src/sigs.k8s.io/gcp-compute-persistent-disk-csi-driver
13+
readonly overlay_name="${GCE_PD_OVERLAY_NAME:-stable}"
14+
readonly boskos_resource_type="${GCE_PD_BOSKOS_RESOURCE_TYPE:-gce-project}"
15+
readonly do_driver_build="${GCE_PD_DO_DRIVER_BUILD:-true}"
16+
readonly deployment_strategy=${DEPLOYMENT_STRATEGY:-gce}
17+
readonly gke_cluster_version=${GKE_CLUSTER_VERSION:-latest}
18+
readonly kube_version=${GCE_PD_KUBE_VERSION:-master}
19+
readonly test_version=${TEST_VERSION:-master}
20+
readonly gce_zone=${GCE_CLUSTER_ZONE:-us-central1-b}
21+
readonly gce_region=${GCE_CLUSTER_REGION:-}
22+
readonly image_type=${IMAGE_TYPE:-cos}
23+
24+
export GCE_PD_VERBOSITY=9
25+
26+
make -C ${PKGDIR} test-k8s-integration
27+
28+
base_cmd="${PKGDIR}/bin/k8s-integration-test \
29+
--run-in-prow=true --deploy-overlay-name=${overlay_name} --service-account-file=${E2E_GOOGLE_APPLICATION_CREDENTIALS} \
30+
--do-driver-build=${do_driver_build} --boskos-resource-type=${boskos_resource_type} \
31+
--storageclass-file=sc-standard.yaml --test-focus="External.Storage" \
32+
--deployment-strategy=${deployment_strategy} --test-version=${test_version} --num-nodes=3 \
33+
--image-type=${image_type}"
34+
35+
if [ "$deployment_strategy" = "gke" ]; then
36+
base_cmd="${base_cmd} --gke-cluster-version=${gke_cluster_version}"
37+
else
38+
base_cmd="${base_cmd} --kube-version=${kube_version}"
39+
fi
40+
41+
if [ -z "$gce_region" ]; then
42+
base_cmd="${base_cmd} --gce-zone=${gce_zone}"
43+
else
44+
base_cmd="${base_cmd} --gce-region=${gce_region}"
45+
fi
46+
47+
eval $base_cmd

0 commit comments

Comments
 (0)