-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: alexgreenbank <alex.greenbank@grafana.com>
- Loading branch information
1 parent
438f48f
commit 092582a
Showing
2 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
# Builds command binaries | ||
set -eufo pipefail | ||
export SHELLOPTS # propagate set to children by default | ||
IFS=$'\t\n' | ||
|
||
command -v go >/dev/null 2>&1 || { echo 'Please install go'; exit 1; } | ||
|
||
export GOPRIVATE="" | ||
export CGO_ENABLED=0 | ||
export GOOS=linux | ||
export GOARCH=amd64 | ||
GIT_COMMIT="${DRONE_COMMIT:-$(git rev-list -1 HEAD)}" | ||
COMMIT_UNIX_TIMESTAMP="$(git --no-pager show -s --format=%ct "${GIT_COMMIT}")" | ||
# DOCKER_TAG="$(bash scripts/docker-tag.sh)" | ||
DOCKER_TAG="TODO" | ||
|
||
# shellcheck disable=SC2043 | ||
for cmd in influx2cortex | ||
do | ||
go build \ | ||
-o "dist/${cmd}" \ | ||
-ldflags "\ | ||
-w \ | ||
-X 'github.com/grafana/mimir-proxies/pkg/appcommon.CommitUnixTimestamp=${COMMIT_UNIX_TIMESTAMP}' \ | ||
-X 'github.com/grafana/mimir-proxies/pkg/appcommon.DockerTag=${DOCKER_TAG}' \ | ||
" \ | ||
"github.com/grafana/influx2cortex/cmd/${cmd}" | ||
|
||
echo "Succesfully built ${cmd} into dist/${cmd}" | ||
done |