aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/run_tests/dockerize/docker_run.sh
blob: 992e4f25b76fdbcd914a080e6447e7ef85f379b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
# Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This script is invoked by build_docker_* inside a docker
# container. You should never need to call this script on your own.

set -ex

if [ "$RELATIVE_COPY_PATH" == "" ]
then
  mkdir -p /var/local/git
  git clone $EXTERNAL_GIT_ROOT /var/local/git/grpc
  # clone gRPC submodules, use data from locally cloned submodules where possible
  (cd ${EXTERNAL_GIT_ROOT} && git submodule foreach 'cd /var/local/git/grpc \
  && git submodule update --init --reference ${EXTERNAL_GIT_ROOT}/${name} \
  ${name}')
else
  mkdir -p "/var/local/git/grpc/$RELATIVE_COPY_PATH"
  cp -r "$EXTERNAL_GIT_ROOT/$RELATIVE_COPY_PATH"/* "/var/local/git/grpc/$RELATIVE_COPY_PATH"
fi

$POST_GIT_STEP

if [ -x "$(command -v rvm)" ]
then
  rvm use ruby-2.1
fi

cd /var/local/git/grpc

$RUN_COMMAND