Skip to content

Commit

Permalink
build: fix local build (#179)
Browse files Browse the repository at this point in the history
Signed-off-by: alexgreenbank <alex.greenbank@grafana.com>
  • Loading branch information
alexgreenbank authored Oct 2, 2024
1 parent 438f48f commit 092582a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/grafana/influx2cortex

go 1.23
go 1.23.0

require (
github.com/ahmetalpbalkan/dlog v0.0.0-20170105205344-4fb5f8204f26
Expand Down
31 changes: 31 additions & 0 deletions scripts/compile_commands.sh
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

0 comments on commit 092582a

Please sign in to comment.