Jan Tattermusch | 7eba172 | 2016-01-19 08:43:00 -0800 | [diff] [blame] | 1 | #!/bin/bash |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 2 | # Copyright 2016 gRPC authors. |
Jan Tattermusch | 7eba172 | 2016-01-19 08:43:00 -0800 | [diff] [blame] | 3 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 4 | # 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 Tattermusch | 7eba172 | 2016-01-19 08:43:00 -0800 | [diff] [blame] | 7 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
Jan Tattermusch | 7eba172 | 2016-01-19 08:43:00 -0800 | [diff] [blame] | 9 | # |
Jan Tattermusch | 7897ae9 | 2017-06-07 22:57:36 +0200 | [diff] [blame] | 10 | # 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 Tattermusch | 7eba172 | 2016-01-19 08:43:00 -0800 | [diff] [blame] | 15 | # |
| 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 Tattermusch | b5f7397 | 2016-02-05 13:53:47 -0800 | [diff] [blame] | 19 | set -ex |
Jan Tattermusch | 7eba172 | 2016-01-19 08:43:00 -0800 | [diff] [blame] | 20 | |
Jan Tattermusch | 92711bb | 2016-02-05 13:10:24 -0800 | [diff] [blame] | 21 | if [ "$RELATIVE_COPY_PATH" == "" ] |
| 22 | then |
| 23 | mkdir -p /var/local/git |
Matt Kwong | 10dccca | 2016-09-28 16:52:34 -0700 | [diff] [blame] | 24 | git clone $EXTERNAL_GIT_ROOT /var/local/git/grpc |
Matt Kwong | 46c7f57 | 2016-09-23 14:36:23 -0700 | [diff] [blame] | 25 | # clone gRPC submodules, use data from locally cloned submodules where possible |
Matt Kwong | 10dccca | 2016-09-28 16:52:34 -0700 | [diff] [blame] | 26 | (cd ${EXTERNAL_GIT_ROOT} && git submodule foreach 'cd /var/local/git/grpc \ |
| 27 | && git submodule update --init --reference ${EXTERNAL_GIT_ROOT}/${name} \ |
Matt Kwong | 5d0f246 | 2016-09-26 12:05:05 -0700 | [diff] [blame] | 28 | ${name}') |
Jan Tattermusch | 92711bb | 2016-02-05 13:10:24 -0800 | [diff] [blame] | 29 | else |
| 30 | mkdir -p "/var/local/git/grpc/$RELATIVE_COPY_PATH" |
Jan Tattermusch | b5f7397 | 2016-02-05 13:53:47 -0800 | [diff] [blame] | 31 | cp -r "$EXTERNAL_GIT_ROOT/$RELATIVE_COPY_PATH"/* "/var/local/git/grpc/$RELATIVE_COPY_PATH" |
Jan Tattermusch | 92711bb | 2016-02-05 13:10:24 -0800 | [diff] [blame] | 32 | fi |
Jan Tattermusch | 7eba172 | 2016-01-19 08:43:00 -0800 | [diff] [blame] | 33 | |
Craig Tiller | 8b78760 | 2016-02-24 15:41:37 -0800 | [diff] [blame] | 34 | $POST_GIT_STEP |
| 35 | |
Jan Tattermusch | 4437213 | 2016-02-01 16:20:03 -0800 | [diff] [blame] | 36 | if [ -x "$(command -v rvm)" ] |
| 37 | then |
| 38 | rvm use ruby-2.1 |
| 39 | fi |
Jan Tattermusch | 7eba172 | 2016-01-19 08:43:00 -0800 | [diff] [blame] | 40 | |
Jan Tattermusch | 92711bb | 2016-02-05 13:10:24 -0800 | [diff] [blame] | 41 | cd /var/local/git/grpc |
| 42 | |
Jan Tattermusch | 7eba172 | 2016-01-19 08:43:00 -0800 | [diff] [blame] | 43 | $RUN_COMMAND |