Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
f97b4f26
Commit
f97b4f26
authored
9 years ago
by
Stanley Cheung
Browse files
Options
Downloads
Patches
Plain Diff
Add per-language homebrew testing for Mac on Jenkins
parent
23a33aae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/jenkins/run_distribution.sh
+75
-20
75 additions, 20 deletions
tools/jenkins/run_distribution.sh
with
75 additions
and
20 deletions
tools/jenkins/run_distribution.sh
+
75
−
20
View file @
f97b4f26
...
@@ -39,19 +39,19 @@ if [ "$platform" == "linux" ]; then
...
@@ -39,19 +39,19 @@ if [ "$platform" == "linux" ]; then
sha1
=
$(
sha1sum
tools/jenkins/grpc_linuxbrew/Dockerfile |
cut
-f1
-d
\
)
sha1
=
$(
sha1sum
tools/jenkins/grpc_linuxbrew/Dockerfile |
cut
-f1
-d
\
)
DOCKER_IMAGE_NAME
=
grpc_linuxbrew_
$sha1
DOCKER_IMAGE_NAME
=
grpc_linuxbrew_
$sha1
# build docker image, contains all pre-requisites
docker build
-t
$DOCKER_IMAGE_NAME
tools/jenkins/grpc_linuxbrew
docker build
-t
$DOCKER_IMAGE_NAME
tools/jenkins/grpc_linuxbrew
supported
=
"python nodejs ruby php"
if
[
"
$language
"
==
"core"
]
;
then
if
[
"
$language
"
==
"core"
]
;
then
command
=
"curl -fsSL https://goo.gl/getgrpc | bash -"
command
=
"curl -fsSL https://goo.gl/getgrpc | bash -"
elif
[[
"
$supported
"
=
~
"
$language
"
]]
;
then
elif
[[
"
python nodejs ruby php
"
=
~
"
$language
"
]]
;
then
command
=
"curl -fsSL https://goo.gl/getgrpc | bash -s
$language
"
command
=
"curl -fsSL https://goo.gl/getgrpc | bash -s
$language
"
else
else
echo
"unsupported language
$language
"
echo
"unsupported language
$language
"
exit
1
exit
1
fi
fi
# run per-language homebrew installation script
docker run
$DOCKER_IMAGE_NAME
bash
-l
\
docker run
$DOCKER_IMAGE_NAME
bash
-l
\
-c
"nvm use 0.12;
\
-c
"nvm use 0.12;
\
npm set unsafe-perm true;
\
npm set unsafe-perm true;
\
...
@@ -66,26 +66,81 @@ if [ "$platform" == "linux" ]; then
...
@@ -66,26 +66,81 @@ if [ "$platform" == "linux" ]; then
elif
[
"
$platform
"
==
"macos"
]
;
then
elif
[
"
$platform
"
==
"macos"
]
;
then
if
[
"
$dist_channel
"
==
"homebrew"
]
;
then
if
[
"
$dist_channel
"
==
"homebrew"
]
;
then
which brew
# TODO: for debug, can be removed lat
er
# system installed homebrew, don't interf
er
e
brew list
-l
brew list
-l
dir
=
/tmp/homebrew-test-
$language
rm
-rf
$dir
# Set up temp directories for test installation of homebrew
mkdir
-p
$dir
brew_root
=
/tmp/homebrew-test-
$language
git clone https://github.com/Homebrew/homebrew.git
$dir
rm
-rf
$brew_root
cd
$dir
mkdir
-p
$brew_root
# TODO: Uncomment these when the general structure of the script is verified
git clone https://github.com/Homebrew/homebrew.git
$brew_root
# PATH=$dir/bin:$PATH brew tap homebrew/dupes
# PATH=$dir/bin:$PATH brew install zlib
# Install grpc via homebrew
# PATH=$dir/bin:$PATH brew install openssl
#
# PATH=$dir/bin:$PATH brew tap grpc/grpc
# The temp $PATH env variable makes sure we are operating at the right copy of
# PATH=$dir/bin:$PATH brew install --without-python google-protobuf
# temp homebrew installation, and do not interfere with the system's main brew
# PATH=$dir/bin:$PATH brew install grpc
# installation.
PATH
=
$dir
/bin:
$PATH
brew list
-l
#
# TODO: replace the next section with the actual homebrew installation script
# i.e. curl -fsSL https://goo.gl/getgrpc | bash -s $language
# need to resolve a bunch of environment and privilege issue on the jenkins
# mac machine itself
local
OLD_PATH
=
$PATH
local
PATH
=
$brew_root
/bin:
$PATH
cd
$brew_root
brew tap homebrew/dupes
brew
install
zlib
brew
install
openssl
brew tap grpc/grpc
brew
install
--without-python
google-protobuf
brew
install
grpc
brew list
-l
brew list
-l
# Install per-language modules/extensions on top of core grpc
#
# If a command below needs root access, the binary had been added to
# /etc/sudoers. This step needs to be repeated if we add more mac instances
# to our jenkins project.
#
# Examples (lines that needed to be added to /etc/sudoers):
# + Defaults env_keep += "CFLAGS CXXFLAGS LDFLAGS enable_grpc"
# + jenkinsnode1 ALL=(ALL) NOPASSWD: /usr/bin/pecl, /usr/local/bin/pip,
# + /usr/local/bin/npm
case
$language
in
*
core
*
)
;;
*
python
*
)
sudo
CFLAGS
=
-I
$brew_root
/include
LDFLAGS
=
-L
$brew_root
/lib pip
install
grpcio
pip list |
grep
grpcio
echo
'y'
|
sudo
pip uninstall grpcio
;;
*
nodejs
*
)
sudo
CXXFLAGS
=
-I
$brew_root
/include
LDFLAGS
=
-L
$brew_root
/lib npm
install
grpc
npm list |
grep
grpc
sudo
npm uninstall grpc
;;
*
ruby
*
)
gem
install
grpc
--
--with-grpc-dir
=
$brew_root
gem list |
grep
grpc
gem uninstall grpc
;;
*
php
*
)
sudo
enable_grpc
=
$brew_root
CFLAGS
=
"-Wno-parentheses-equality"
pecl
install
grpc-alpha
pecl list |
grep
grpc
sudo
pecl uninstall grpc
;;
*
)
echo
"Unsupported language
$language
"
exit
1
;;
esac
# clean up
cd
~/
cd
~/
rm
-rf
$dir
rm
-rf
$brew_root
echo
$PATH
# TODO: for debug, can be removed later
brew list
-l
# TODO: for debug, can be removed later
# Make sure the system brew installation is still unaffected
local
PATH
=
$OLD_PATH
brew list
-l
else
else
echo
"Unsupported
$platform
dist_channel
$dist_channel
"
echo
"Unsupported
$platform
dist_channel
$dist_channel
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment