Skip to content

Commit

Permalink
Fixes for proto3 on travis and docker.
Browse files Browse the repository at this point in the history
  • Loading branch information
destijl committed Sep 2, 2016
1 parent c535d69 commit af9146c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cache:
- $HOME/.cache/pip
- $HOME/protobuf
before_install:
- /bin/bash travis/install_protobuf.sh
- /bin/bash travis/install_protobuf.sh $TRAVIS_OS_NAME
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install libffi && git clone https://github.com/MacPython/terryfy && source terryfy/travis_tools.sh; get_python_environment macpython 2.7.11; fi
# We upgrade pip inside the virtualenv to avoid sudo here.
- pip install --upgrade virtualenv
Expand Down
9 changes: 7 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# A Docker container capable of running all GRR components.
# Xenial has the correct version of the protobuf compiler (2.6.1).
FROM ubuntu:xenial
MAINTAINER Greg Castle [email protected]

Expand All @@ -12,7 +11,6 @@ RUN apt-get update && \
libffi-dev \
libssl-dev \
prelink \
protobuf-compiler \
python-dev \
python-pip \
rpm \
Expand All @@ -23,6 +21,13 @@ RUN apt-get update && \
pip install setuptools --upgrade && \
virtualenv /usr/share/grr-server

# Install proto compiler
RUN mkdir -p /usr/share/protobuf && \
cd /usr/share/protobuf && \
wget --quiet "https://github.com/google/protobuf/releases/download/v3.0.0/protoc-3.0.0-linux-x86_64.zip" && \
unzip protoc-3.0.0-linux-x86_64.zip
ENV PROTOC /usr/share/protobuf/bin/protoc

# Make sure Bower will be able to run as root.
# Install nodeenv, a prebuilt version of NodeJS and update the virtualenv
# environment.
Expand Down
3 changes: 2 additions & 1 deletion travis/install_protobuf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

set -e

OS=$1
VERSION=3.0.0
ARCH=$(uname -m)
# Get arch in the format that the protobuf urls use
Expand All @@ -16,7 +17,7 @@ if [ ! -d "${HOME}/protobuf/bin" ]; then
cwd=$(pwd)
mkdir -p "${HOME}/protobuf"
cd "${HOME}/protobuf"
wget "https://github.com/google/protobuf/releases/download/v${VERSION}/protoc-${VERSION}-linux-${ARCH}.zip"
wget --quiet "https://github.com/google/protobuf/releases/download/v${VERSION}/protoc-${VERSION}-${OS}-${ARCH}.zip"
unzip "protoc-${VERSION}-linux-${ARCH}.zip"
cd "${cwd}"
else
Expand Down
2 changes: 1 addition & 1 deletion vagrant/windows/install_for_build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ start /wait msiexec.exe /i C:\grr_deps\VCForPython27.msi /passive
echo Installing protobuf compiler
powershell -NoProfile -ExecutionPolicy unrestricted -Command "(new-object System.Net.WebClient).DownloadFile('https://github.com/google/protobuf/releases/download/v3.0.0/protoc-3.0.0-win32.zip', 'C:\grr_deps\protoc-3.0.0-win32.zip')"
C:\Python27-x64\python.exe -m "zipfile" -e C:\grr_deps\protoc-3.0.0-win32.zip C:\grr_deps\protoc
C:\grr_deps\protoc\protoc.exe --version || echo "proto compiler install failed" && exit /b 1
C:\grr_deps\protoc\bin\protoc.exe --version || echo "proto compiler install failed" && exit /b 1

echo GRR dependency installation complete

0 comments on commit af9146c

Please sign in to comment.