diff --git a/.travis.yml b/.travis.yml index 9d3b2a30eb4..fc690dbea8f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ cache: - $HOME/local - ${TRAVIS_BUILD_DIR}/examples/browser/node_modules before_install: -- ./.travis/build-protoc.sh 3.0.0-beta-3 +- ./.travis/install-protoc.sh 3.0.0 - ./.travis/install-swagger-codegen.sh 2.1.6 - nvm install v6.1 && nvm use v6.1 && node --version - go get github.com/golang/lint/golint diff --git a/.travis/build-protoc.sh b/.travis/build-protoc.sh deleted file mode 100755 index 0dc92a8e2a7..00000000000 --- a/.travis/build-protoc.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -eu -protoc_version=$1 -if test -z "${protoc_version}"; then - echo "Usage: .travis/build-protoc.sh protoc-version" - exit 1 -fi -if ! $HOME/local/bin/protoc-${protoc_version} --version 2>/dev/null; then - rm -rf $HOME/local - - mkdir -p $HOME/tmp - cd $HOME/tmp - wget https://github.com/google/protobuf/archive/v${protoc_version}.tar.gz - tar xvzf v${protoc_version}.tar.gz - cd protobuf-${protoc_version} - ./autogen.sh - ./configure --prefix=$HOME/local --program-suffix=-${protoc_version} - make -j 4 - make install -fi -ln -sf $HOME/local/bin/protoc-${protoc_version} $HOME/local/bin/protoc - -echo \$ $HOME/local/bin/protoc --version -$HOME/local/bin/protoc --version diff --git a/.travis/install-protoc.sh b/.travis/install-protoc.sh new file mode 100755 index 00000000000..65d9be7b266 --- /dev/null +++ b/.travis/install-protoc.sh @@ -0,0 +1,19 @@ +#!/bin/sh -eu +protoc_version=$1 +if test -z "${protoc_version}"; then + echo "Usage: .travis/install-protoc.sh protoc-version" + exit 1 +fi +if "`$HOME/local/bin/protoc-${protoc_version} --version 2>/dev/null | cut -d' ' -f 2`" != ${protoc_version}; then + rm -rf $HOME/local/bin $HOME/local/include + + mkdir -p $HOME/tmp $HOME/local + cd $HOME/tmp + wget https://github.com/google/protobuf/releases/download/v${protoc_version}/protoc-${protoc_version}-linux-x86_64.zip + unzip protoc-${protoc_version}-linux-x86_64.zip + mv bin $HOME/local/bin + mv include $HOME/local/include +fi + +echo \$ $HOME/local/bin/protoc --version +$HOME/local/bin/protoc --version