aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Jan Tattermusch <jtattermusch@google.com>2015-12-09 12:51:02 -0800
committerGravatar Jan Tattermusch <jtattermusch@google.com>2015-12-09 12:59:30 -0800
commit1c8c7ee7455d014214be2db36ddd906102a18704 (patch)
tree3dc17810c3a25a76fbebb914c7c518ed2210314a /tools
parent141272d5de00b0a41e26b2bbea5629a5c79b5ca2 (diff)
try to prevent PHP interop flake
Diffstat (limited to 'tools')
-rw-r--r--tools/jenkins/grpc_interop_php/Dockerfile14
-rwxr-xr-xtools/jenkins/grpc_interop_php/build_interop.sh10
2 files changed, 15 insertions, 9 deletions
diff --git a/tools/jenkins/grpc_interop_php/Dockerfile b/tools/jenkins/grpc_interop_php/Dockerfile
index 09da713691..492d20cdb5 100644
--- a/tools/jenkins/grpc_interop_php/Dockerfile
+++ b/tools/jenkins/grpc_interop_php/Dockerfile
@@ -100,5 +100,19 @@ RUN /bin/bash -l -c "rvm all do gem install ronn rake"
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
+# Download the patched PHP protobuf so that PHP gRPC clients can be generated
+# from proto3 schemas.
+RUN git clone https://github.com/stanley-cheung/Protobuf-PHP.git /var/local/git/protobuf-php
+
+RUN /bin/bash -l -c "rvm use ruby-2.1 \
+ && cd /var/local/git/protobuf-php \
+ && rvm all do rake pear:package version=1.0 \
+ && pear install Protobuf-1.0.tgz"
+
+# As an attempt to work around #4212, try to prefetch Protobuf-PHP dependency
+# into composer cache to prevent "composer install" from cloning on each build.
+RUN git clone --mirror https://github.com/stanley-cheung/Protobuf-PHP.git \
+ /root/.composer/cache/vcs/git-github.com-stanley-cheung-Protobuf-PHP.git/
+
# Define the default command.
CMD ["bash"]
diff --git a/tools/jenkins/grpc_interop_php/build_interop.sh b/tools/jenkins/grpc_interop_php/build_interop.sh
index cd9d67804a..87262f1d62 100755
--- a/tools/jenkins/grpc_interop_php/build_interop.sh
+++ b/tools/jenkins/grpc_interop_php/build_interop.sh
@@ -29,7 +29,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Builds PHP interop server and client in a base image.
-set -e
+set -ex
mkdir -p /var/local/git
git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc
@@ -45,18 +45,10 @@ make install-certs
# gRPC core and protobuf need to be installed
make install
-# Download the patched PHP protobuf so that PHP gRPC clients can be generated
-# from proto3 schemas.
-git clone https://github.com/stanley-cheung/Protobuf-PHP.git /var/local/git/protobuf-php
-
(cd src/php/ext/grpc && phpize && ./configure && make)
(cd third_party/protobuf && make install)
-(cd /var/local/git/protobuf-php \
- && rvm all do rake pear:package version=1.0 \
- && pear install Protobuf-1.0.tgz)
-
(cd src/php && composer install)
(cd src/php && protoc-gen-php -i tests/interop/ -o tests/interop/ tests/interop/test.proto)