Skip to content

Commit c3e3585

Browse files
authored
Added option to use a particular branch with the e2e script (#24)
* Added option to use a particular branch * update usage
1 parent d5e7edb commit c3e3585

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Kubernetes master is running at https://xyz
2222
If you want to use a local [minikube](https://github.com/kubernetes/minikube) cluster,
2323
the minimum tested version is 0.23.0, with the kube-dns addon enabled
2424
and the recommended configuration is 3 CPUs and 4G of memory. There is also a wrapper
25-
script for running on minikube, `e2e/e2e-minikube.sh` for testing the apache/spark repo
26-
in specific.
25+
script for running on minikube, `e2e/e2e-minikube.sh` for testing the master branch
26+
of the apache/spark repository in specific.
2727

2828
```
2929
$ minikube start --memory 4000 --cpus 3
@@ -39,7 +39,7 @@ Example usages of the script:
3939
$ ./e2e/runner.sh -m https://xyz -i docker.io/foxish -d cloud
4040
$ ./e2e/runner.sh -m https://xyz -i test -d minikube
4141
$ ./e2e/runner.sh -m https://xyz -i test -r https://github.com/my-spark/spark -d minikube
42-
42+
$ ./e2e/runner.sh -m https://xyz -i test -r https://github.com/my-spark/spark -b my-branch -d minikube
4343
```
4444

4545
# Detailed Documentation

e2e/runner.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
usage () {
1919
echo "Usage:"
2020
echo " ./e2e/runner.sh -h Display this help message."
21-
echo " ./e2e/runner.sh -m <master-url> -r <spark-repo> -i <image-repo> -d [minikube|cloud]"
21+
echo " ./e2e/runner.sh -m <master-url> -r <spark-repo> -b <branch> -i <image-repo> -d [minikube|cloud]"
2222
echo " note that you must have kubectl configured to access the specified"
2323
echo " <master-url>. Also you must have access to the <image-repo>. "
2424
echo " The deployment mode can be specified using the 'd' flag."
@@ -35,9 +35,10 @@ fi
3535
REPO="https://github.com/apache/spark"
3636
IMAGE_REPO="docker.io/kubespark"
3737
DEPLOY_MODE="minikube"
38+
BRANCH="master"
3839

3940
### Parse options ###
40-
while getopts h:m:r:i:d: option
41+
while getopts h:m:r:i:d:b: option
4142
do
4243
case "${option}"
4344
in
@@ -47,6 +48,7 @@ do
4748
;;
4849
m) MASTER=${OPTARG};;
4950
r) REPO=${OPTARG};;
51+
b) BRANCH=${OPTARG};;
5052
i) IMAGE_REPO=${OPTARG};;
5153
d) DEPLOY_MODE=${OPTARG};;
5254
\? )
@@ -82,12 +84,14 @@ root=$(pwd)
8284
# clone spark distribution if needed.
8385
if [ -d "spark" ];
8486
then
85-
(cd spark && git pull);
87+
(cd spark && git pull origin $BRANCH);
8688
else
8789
git clone $REPO;
8890
fi
8991

90-
cd spark && ./dev/make-distribution.sh --tgz -Phadoop-2.7 -Pkubernetes -DskipTests
92+
cd spark
93+
git checkout -B $BRANCH origin/$BRANCH
94+
./dev/make-distribution.sh --tgz -Phadoop-2.7 -Pkubernetes -DskipTests
9195
tag=$(git rev-parse HEAD | cut -c -6)
9296
echo "Spark distribution built at SHA $tag"
9397

0 commit comments

Comments
 (0)