blob: 992e4f25b76fdbcd914a080e6447e7ef85f379b3 [file] [log] [blame]
Jan Tattermusch7eba1722016-01-19 08:43:00 -08001#!/bin/bash
Jan Tattermusch7897ae92017-06-07 22:57:36 +02002# Copyright 2016 gRPC authors.
Jan Tattermusch7eba1722016-01-19 08:43:00 -08003#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02004# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
Jan Tattermusch7eba1722016-01-19 08:43:00 -08007#
Jan Tattermusch7897ae92017-06-07 22:57:36 +02008# http://www.apache.org/licenses/LICENSE-2.0
Jan Tattermusch7eba1722016-01-19 08:43:00 -08009#
Jan Tattermusch7897ae92017-06-07 22:57:36 +020010# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Jan Tattermusch7eba1722016-01-19 08:43:00 -080015#
16# This script is invoked by build_docker_* inside a docker
17# container. You should never need to call this script on your own.
18
Jan Tattermuschb5f73972016-02-05 13:53:47 -080019set -ex
Jan Tattermusch7eba1722016-01-19 08:43:00 -080020
Jan Tattermusch92711bb2016-02-05 13:10:24 -080021if [ "$RELATIVE_COPY_PATH" == "" ]
22then
23 mkdir -p /var/local/git
Matt Kwong10dccca2016-09-28 16:52:34 -070024 git clone $EXTERNAL_GIT_ROOT /var/local/git/grpc
Matt Kwong46c7f572016-09-23 14:36:23 -070025 # clone gRPC submodules, use data from locally cloned submodules where possible
Matt Kwong10dccca2016-09-28 16:52:34 -070026 (cd ${EXTERNAL_GIT_ROOT} && git submodule foreach 'cd /var/local/git/grpc \
27 && git submodule update --init --reference ${EXTERNAL_GIT_ROOT}/${name} \
Matt Kwong5d0f2462016-09-26 12:05:05 -070028 ${name}')
Jan Tattermusch92711bb2016-02-05 13:10:24 -080029else
30 mkdir -p "/var/local/git/grpc/$RELATIVE_COPY_PATH"
Jan Tattermuschb5f73972016-02-05 13:53:47 -080031 cp -r "$EXTERNAL_GIT_ROOT/$RELATIVE_COPY_PATH"/* "/var/local/git/grpc/$RELATIVE_COPY_PATH"
Jan Tattermusch92711bb2016-02-05 13:10:24 -080032fi
Jan Tattermusch7eba1722016-01-19 08:43:00 -080033
Craig Tiller8b787602016-02-24 15:41:37 -080034$POST_GIT_STEP
35
Jan Tattermusch44372132016-02-01 16:20:03 -080036if [ -x "$(command -v rvm)" ]
37then
38 rvm use ruby-2.1
39fi
Jan Tattermusch7eba1722016-01-19 08:43:00 -080040
Jan Tattermusch92711bb2016-02-05 13:10:24 -080041cd /var/local/git/grpc
42
Jan Tattermusch7eba1722016-01-19 08:43:00 -080043$RUN_COMMAND