From 95ccfd6ae1620d71f4b968780bbc79d41de331eb Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Wed, 1 Aug 2018 13:27:06 -0700 Subject: [PATCH 1/2] Add protoc to project --- Vagrantfile | 4 ++++ scripts/vagrant-linux-priv-protoc.sh | 32 ++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100755 scripts/vagrant-linux-priv-protoc.sh diff --git a/Vagrantfile b/Vagrantfile index b3b9a1125..6f2ba1ae1 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -144,6 +144,10 @@ def configureLinuxProvisioners(vmCfg) privileged: false, path: './scripts/vagrant-linux-priv-ui.sh' + vmCfg.vm.provision "shell", + privileged: false, + path: './scripts/vagrant-linux-priv-protoc.sh' + return vmCfg end diff --git a/scripts/vagrant-linux-priv-protoc.sh b/scripts/vagrant-linux-priv-protoc.sh new file mode 100755 index 000000000..6e5ab7715 --- /dev/null +++ b/scripts/vagrant-linux-priv-protoc.sh @@ -0,0 +1,32 @@ +# Make sure you grab the latest version +#!/usr/bin/env bash + +set -o errexit + +VERSION=3.6.1 +DOWNLOAD=https://github.com/google/protobuf/releases/download/v${VERSION}/protoc-${VERSION}-linux-x86_64.zip + +function install_protoc() { + if [[ -e /usr/local/bin/protoc ]] ; then + if [ "${VERSION}" = "$(protoc --version | cut -d ' ' -f 2)" ] ; then + return + fi + fi + + # Download + wget -q -O /tmp/protoc.zip ${DOWNLOAD} + + # Unzip + unzip /tmp/protoc.zip -d /tmp/protoc3 + + # Move protoc to /usr/local/bin/ + sudo mv /tmp/protoc3/bin/* /usr/local/bin/ + + # Move protoc3/include to /usr/local/include/ + sudo mv /tmp/protoc3/include/* /usr/local/include/ + + # Link + sudo ln -s /usr/local/bin/protoc /usr/bin/protoc +} + +install_protoc From 7f5c37de75f48c5cf6f5d6c2da734bfdf6e048e6 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Wed, 1 Aug 2018 13:50:40 -0700 Subject: [PATCH 2/2] Remove old protoc installer --- Vagrantfile | 6 +----- scripts/vagrant-linux-protoc.sh | 8 -------- 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100755 scripts/vagrant-linux-protoc.sh diff --git a/Vagrantfile b/Vagrantfile index 6f2ba1ae1..529db0890 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -138,14 +138,10 @@ def configureLinuxProvisioners(vmCfg) vmCfg.vm.provision "shell", privileged: true, - path: './scripts/vagrant-linux-protoc.sh' - - vmCfg.vm.provision "shell", - privileged: false, path: './scripts/vagrant-linux-priv-ui.sh' vmCfg.vm.provision "shell", - privileged: false, + privileged: true, path: './scripts/vagrant-linux-priv-protoc.sh' return vmCfg diff --git a/scripts/vagrant-linux-protoc.sh b/scripts/vagrant-linux-protoc.sh deleted file mode 100755 index 7d0a52249..000000000 --- a/scripts/vagrant-linux-protoc.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -# set up protoc so that we can use it for protobuf generation -PROTOC_ZIP=protoc-3.6.1-linux-x86_64.zip -curl -OL https://github.com/google/protobuf/releases/download/v3.6.1/$PROTOC_ZIP -sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc -rm -f $PROTOC_ZIP -