aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2015-07-19 21:55:12 -0700
committerGravatar Jan Tattermusch <jtattermusch@users.noreply.github.com>2015-07-19 21:55:12 -0700
commit9b602e06dc631d4fc0f471f2618a3ba2a40bc150 (patch)
tree86ebd815664f84302c6176b0b08942989f8dbc97
parentf08b067cdbb4000cd997f1aa0641b97db16ebaf8 (diff)
parent17bb3ec9212bb773d434e2d8ad126e3adb7abff0 (diff)
Merge pull request #2491 from stanley-cheung/add_homebrew_to_jenkins
Support macos in jenkins run_distributions script
-rwxr-xr-xtools/jenkins/run_distribution.sh72
1 files changed, 57 insertions, 15 deletions
diff --git a/tools/jenkins/run_distribution.sh b/tools/jenkins/run_distribution.sh
index 10c41b4099..fb1404b10c 100755
--- a/tools/jenkins/run_distribution.sh
+++ b/tools/jenkins/run_distribution.sh
@@ -32,24 +32,66 @@
# linuxbrew installation of a selected language
set -ex
-sha1=$(sha1sum tools/jenkins/grpc_linuxbrew/Dockerfile | cut -f1 -d\ )
-DOCKER_IMAGE_NAME=grpc_linuxbrew_$sha1
+if [ "$platform" == "linux" ]; then
-docker build -t $DOCKER_IMAGE_NAME tools/jenkins/grpc_linuxbrew
+ if [ "$dist_channel" == "homebrew" ]; then
-supported="python nodejs ruby php"
+ sha1=$(sha1sum tools/jenkins/grpc_linuxbrew/Dockerfile | cut -f1 -d\ )
+ DOCKER_IMAGE_NAME=grpc_linuxbrew_$sha1
+
+ docker build -t $DOCKER_IMAGE_NAME tools/jenkins/grpc_linuxbrew
+
+ supported="python nodejs ruby php"
+
+ if [ "$language" == "core" ]; then
+ command="curl -fsSL https://goo.gl/getgrpc | bash -"
+ elif [[ "$supported" =~ "$language" ]]; then
+ command="curl -fsSL https://goo.gl/getgrpc | bash -s $language"
+ else
+ echo "unsupported language $language"
+ exit 1
+ fi
+
+ docker run $DOCKER_IMAGE_NAME bash -l \
+ -c "nvm use 0.12; \
+ npm set unsafe-perm true; \
+ rvm use ruby-2.1; \
+ $command"
+
+ else
+ echo "Unsupported $platform dist_channel $dist_channel"
+ exit 1
+ fi
+
+elif [ "$platform" == "macos" ]; then
+
+ if [ "$dist_channel" == "homebrew" ]; then
+ which brew # TODO: for debug, can be removed later
+ brew list -l
+ rm -rf /tmp/homebrew-test
+ mkdir -p /tmp/homebrew-test
+ git clone https://github.com/Homebrew/homebrew.git /tmp/homebrew-test
+ cd /tmp/homebrew-test
+ # TODO: Uncomment these when the general structure of the script is verified
+ # PATH=/tmp/homebrew-test/bin:$PATH brew tap homebrew/dupes
+ # PATH=/tmp/homebrew-test/bin:$PATH brew install zlib
+ # PATH=/tmp/homebrew-test/bin:$PATH brew install openssl
+ # PATH=/tmp/homebrew-test/bin:$PATH brew tap grpc/grpc
+ # PATH=/tmp/homebrew-test/bin:$PATH brew install --without-python google-protobuf
+ # PATH=/tmp/homebrew-test/bin:$PATH brew install grpc
+ PATH=/tmp/homebrew-test/bin:$PATH brew list -l
+ brew list -l
+ cd ~/
+ rm -rf /tmp/homebrew-test
+ echo $PATH # TODO: for debug, can be removed later
+ brew list -l # TODO: for debug, can be removed later
+
+ else
+ echo "Unsupported $platform dist_channel $dist_channel"
+ exit 1
+ fi
-if [ "$language" == "core" ]; then
- command="curl -fsSL https://goo.gl/getgrpc | bash -"
-elif [[ "$supported" =~ "$language" ]]; then
- command="curl -fsSL https://goo.gl/getgrpc | bash -s $language"
else
- echo "unsupported language $language"
+ echo "unsupported platform $platform"
exit 1
fi
-
-docker run $DOCKER_IMAGE_NAME bash -l \
- -c "nvm use 0.12; \
- npm set unsafe-perm true; \
- rvm use ruby-2.1; \
- $command"