aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/gce_setup
diff options
context:
space:
mode:
authorGravatar Donna Dionne <donnadionne@google.com>2015-04-20 09:52:44 -0700
committerGravatar Donna Dionne <donnadionne@google.com>2015-04-20 09:52:44 -0700
commitf9f8aca5b043197aa4471fec7000f4443824b818 (patch)
tree832911f80171aa0dd5cc9498549d8fb8d8b0821f /tools/gce_setup
parentdb38bb1d824833a509facbe76a0a8b4d25add99b (diff)
Scripts to build java and cxx docker images from local (uncommitted) code and
run interop tests in GCE VMs.
Diffstat (limited to 'tools/gce_setup')
-rwxr-xr-xtools/gce_setup/private_build_and_test.sh54
1 files changed, 54 insertions, 0 deletions
diff --git a/tools/gce_setup/private_build_and_test.sh b/tools/gce_setup/private_build_and_test.sh
new file mode 100755
index 0000000000..c5c6c58a17
--- /dev/null
+++ b/tools/gce_setup/private_build_and_test.sh
@@ -0,0 +1,54 @@
+#!/bin/bash
+
+# This script has to be run from the same directory as grpc_docker.sh and after grpc_docker.sh is sourced
+#
+# Sample Usage:
+# ===============================
+# ./private_build_and_test.sh [language] [environment: interop|cloud] [test case]
+# [git base directory] [server name in interop environment]
+# sh private_build_and_test.sh java interop large_unary /usr/local/google/home/donnadionne/grpc-git grpc-docker-server1
+# sh private_build_and_test.sh java cloud large_unary /usr/local/google/home/donnadionne/grpc-git
+# ===============================
+
+# Arguments
+LANGUAGE=$1
+ENV=$2
+TEST=$3
+GIT=$4
+SERVER=${5:-"grpc-docker-server"}
+
+sudo docker run --name="private_images" -v $4:/var/local/git-clone grpc/$1 /var/local/git-clone/grpc/tools/dockerfile/grpc_$1/build.sh
+
+sudo docker commit -m "private image" -a "donnadionne" private_images grpc/private_images
+
+sudo docker tag -f grpc/private_images 0.0.0.0:5000/grpc/private_images
+
+sudo docker push 0.0.0.0:5000/grpc/private_images
+
+sudo docker rmi -f grpc/private_images
+
+sudo docker rm private_images
+
+gcloud compute --project "stoked-keyword-656" ssh --zone "asia-east1-a" "grpc-docker-testclients1" --command "sudo docker pull 0.0.0.0:5000/grpc/private_images"
+
+gcloud compute --project "stoked-keyword-656" ssh --zone "asia-east1-a" "grpc-docker-testclients1" --command "sudo docker tag 0.0.0.0:5000/grpc/private_images grpc/$1"
+
+source grpc_docker.sh
+
+if [ $ENV == 'interop' ]
+then
+ grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER cxx
+ grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER java
+ grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER go
+ grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER ruby
+ grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER node
+ grpc_interop_test $TEST grpc-docker-testclients1 $LANGUAGE $SERVER python
+else
+ if [ $ENV == 'cloud' ]
+ then
+ grpc_cloud_prod_test $TEST grpc-docker-testclients1 $LANGUAGE
+ else
+ grpc_cloud_prod_test $TEST grpc-docker-testclients1 $LANGUAGE
+ fi
+fi
+