mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 10:25:42 +03:00
proto: Switch to using buf (#9308)
This replaces all usage of `protoc` with `buf`. See `tools/buf/README.md` for more.
This commit is contained in:
@@ -24,8 +24,8 @@ RUN /tmp/scripts/vagrant-linux-priv-config.sh
|
||||
COPY ./scripts/vagrant-linux-priv-go.sh /tmp/scripts/vagrant-linux-priv-go.sh
|
||||
RUN /tmp/scripts/vagrant-linux-priv-go.sh
|
||||
|
||||
COPY ./scripts/vagrant-linux-priv-protoc.sh /tmp/scripts/vagrant-linux-priv-protoc.sh
|
||||
RUN /tmp/scripts/vagrant-linux-priv-protoc.sh
|
||||
COPY ./scripts/vagrant-linux-priv-buf.sh /tmp/scripts/vagrant-linux-priv-buf.sh
|
||||
RUN /tmp/scripts/vagrant-linux-priv-buf.sh
|
||||
|
||||
USER vagrant
|
||||
|
||||
|
||||
26
scripts/vagrant-linux-priv-buf.sh
Executable file
26
scripts/vagrant-linux-priv-buf.sh
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
|
||||
# Make sure you grab the latest version
|
||||
VERSION=0.30.1
|
||||
DOWNLOAD=https://github.com/bufbuild/buf/releases/download/v${VERSION}/buf-Linux-x86_64
|
||||
|
||||
function install() {
|
||||
if command -v buf >/dev/null; then
|
||||
if [ "${VERSION}" = "$(buf --version)" ] ; then
|
||||
return
|
||||
fi
|
||||
fi
|
||||
|
||||
# Download
|
||||
curl -sSL --fail "$DOWNLOAD" -o /tmp/buf
|
||||
|
||||
# make executable
|
||||
chmod +x /tmp/buf
|
||||
|
||||
# Move buf to /usr/bin
|
||||
mv /tmp/buf /usr/bin/buf
|
||||
}
|
||||
|
||||
install
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -o errexit
|
||||
|
||||
# Make sure you grab the latest version
|
||||
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
|
||||
curl -sSL --fail -o /tmp/protoc.zip ${DOWNLOAD}
|
||||
|
||||
# Unzip
|
||||
unzip /tmp/protoc.zip -d /tmp/protoc3
|
||||
|
||||
# all protoc files should be world-wide readable, specially the include files
|
||||
chmod -R a+r /tmp/protoc3
|
||||
|
||||
# Move protoc to /usr/local/bin/
|
||||
mv /tmp/protoc3/bin/* /usr/local/bin/
|
||||
|
||||
# Move protoc3/include to /usr/local/include/
|
||||
mv /tmp/protoc3/include/* /usr/local/include/
|
||||
|
||||
# Link
|
||||
ln -s /usr/local/bin/protoc /usr/bin/protoc
|
||||
|
||||
rm -rf /tmp/protoc3 /tmp/protoc.zip
|
||||
}
|
||||
|
||||
install_protoc
|
||||
Reference in New Issue
Block a user