fx build fix
This commit is contained in:
@@ -34,14 +34,18 @@ steps:
|
|||||||
"$GIT_REV" "$BUILD_BRANCH" "$APP_V" "$BUILD_DATE" "$BUILD_USER" | tee .env.version
|
"$GIT_REV" "$BUILD_BRANCH" "$APP_V" "$BUILD_DATE" "$BUILD_USER" | tee .env.version
|
||||||
|
|
||||||
- name: proto
|
- name: proto
|
||||||
image: golang:latest
|
image: golang:alpine
|
||||||
depends_on: [ version ]
|
depends_on: [ version ]
|
||||||
commands:
|
commands:
|
||||||
- set -eu
|
- set -eu
|
||||||
- if set -o | grep -q pipefail; then set -o pipefail; fi
|
- if set -o | grep -q pipefail; then set -o pipefail; fi
|
||||||
- apt-get update >/dev/null
|
- apk add --no-cache \
|
||||||
- DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends protobuf-compiler >/dev/null
|
bash \
|
||||||
- rm -rf /var/lib/apt/lists/*
|
git \
|
||||||
|
build-base \
|
||||||
|
protobuf \
|
||||||
|
protobuf-dev \
|
||||||
|
protoc
|
||||||
- go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
- go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||||
- go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
- go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||||
- export PATH="$(go env GOPATH)/bin:$PATH"
|
- export PATH="$(go env GOPATH)/bin:$PATH"
|
||||||
|
|||||||
@@ -7,22 +7,7 @@ REPO_ROOT="$(cd "${SCRIPT_DIR}/../../.." && pwd)"
|
|||||||
API_DIR="${REPO_ROOT}/api"
|
API_DIR="${REPO_ROOT}/api"
|
||||||
PROTO_DIR="./proto"
|
PROTO_DIR="./proto"
|
||||||
PROTOC_BIN="${PROTOC:-protoc}"
|
PROTOC_BIN="${PROTOC:-protoc}"
|
||||||
PROTOC_INCLUDE="${PROTOC_INCLUDE:-}"
|
PROTOC_INCLUDE="$("${PROTOC_BIN}" --print_include_path 2>/dev/null)"
|
||||||
if [ -z "${PROTOC_INCLUDE}" ]; then
|
|
||||||
PROTOC_INCLUDE="$("${PROTOC_BIN}" --print_include_path 2>/dev/null || true)"
|
|
||||||
fi
|
|
||||||
if [ -z "${PROTOC_INCLUDE}" ] || [ ! -f "${PROTOC_INCLUDE}/google/protobuf/timestamp.proto" ]; then
|
|
||||||
for candidate in /usr/include /usr/local/include /usr/lib/include /usr/local/share/include "$(dirname "${PROTOC_BIN}")/../include"; do
|
|
||||||
if [ -f "${candidate}/google/protobuf/timestamp.proto" ]; then
|
|
||||||
PROTOC_INCLUDE="${candidate}"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
if [ -z "${PROTOC_INCLUDE}" ] || [ ! -f "${PROTOC_INCLUDE}/google/protobuf/timestamp.proto" ]; then
|
|
||||||
echo "[proto] failed to locate google/protobuf well-known types; set PROTOC_INCLUDE" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! command -v "${PROTOC_BIN}" >/dev/null 2>&1; then
|
if ! command -v "${PROTOC_BIN}" >/dev/null 2>&1; then
|
||||||
echo "[proto] protoc binary not found" >&2
|
echo "[proto] protoc binary not found" >&2
|
||||||
|
|||||||
Reference in New Issue
Block a user