Skip to content

Instantly share code, notes, and snippets.

@dzintars
Last active January 4, 2022 17:19
Show Gist options
  • Save dzintars/f0c34c5b13f4cd7bb49e52e046e49664 to your computer and use it in GitHub Desktop.
Save dzintars/f0c34c5b13f4cd7bb49e52e046e49664 to your computer and use it in GitHub Desktop.
Install protoc-gen-go
#!/bin/sh
# Author: Dzintars Klavins
# This script will install Protoc compiler
# Don't forget to make this file executable
###################################
# Protocol Buffers installation #
###################################
#https://github.com/protocolbuffers/protobuf/releases
# Make sure you grab the latest version
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v3.12.4/protoc-3.12.4-linux-x86_64.zip
# Unzip
unzip protoc-3.12.4-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
sudo mv protoc3/include/* /usr/local/include/
# In order to use `google.protobuf.Timestamp annotations` be sure `/usr/local/include/` is in your PATH
# https://github.com/oswee/api/issues/1
# Optional: change owner (Solution to "protoc-gen-go: program not found or is not executable" )
# sudo chown $USER /usr/local/bin/protoc
# sudo chown -R $USER /usr/local/include/google
protoc --version
# !!! If any errors occur check permissions on those directories in /usr/bin !!!
@dzintars
Copy link
Author

dzintars commented Jan 4, 2022

Moved into oswee.core.protoc Ansible role

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment