mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 16:51:55 +00:00
29 lines
803 B
Bash
Executable File
29 lines
803 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# This script builds the precise-code-intel-api-server docker image.
|
|
|
|
cd "$(dirname "${BASH_SOURCE[0]}")/../.."
|
|
set -eu
|
|
|
|
OUTPUT=$(mktemp -d -t sgdockerbuild_XXXXXXX)
|
|
cleanup() {
|
|
rm -rf "$OUTPUT"
|
|
}
|
|
trap cleanup EXIT
|
|
|
|
# Environment for building linux binaries
|
|
export GO111MODULE=on
|
|
export GOARCH=amd64
|
|
export GOOS=linux
|
|
|
|
echo "--- go build"
|
|
pkg="github.com/sourcegraph/sourcegraph/cmd/precise-code-intel-api-server"
|
|
go build -trimpath -ldflags "-X github.com/sourcegraph/sourcegraph/internal/version.version=$VERSION" -buildmode exe -tags dist -o "$OUTPUT/$(basename $pkg)" "$pkg"
|
|
|
|
echo "--- docker build"
|
|
docker build -f cmd/precise-code-intel-api-server/Dockerfile -t "$IMAGE" "$OUTPUT" \
|
|
--progress=plain \
|
|
--build-arg COMMIT_SHA \
|
|
--build-arg DATE \
|
|
--build-arg VERSION
|