Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit 69d0414

Browse files
committed
move metrictank.go to cmd directory
fix #923
1 parent 89f6998 commit 69d0414

File tree

5 files changed

+20
-48
lines changed

5 files changed

+20
-48
lines changed

.circleci/config.yml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ jobs:
77
steps:
88
- checkout
99
- run: scripts/build.sh
10-
- run: scripts/build_tools.sh
1110
- setup_remote_docker
1211
- run: scripts/build_docker.sh
1312
- run: mkdir build_docker

Makefile

-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ check:
77
$(MAKE) test
88
bin:
99
./scripts/build.sh
10-
./scripts/build_tools.sh
1110
bin-race:
1211
./scripts/build.sh -race
13-
./scripts/build_tools.sh -race
1412
docker:
1513
./scripts/build_docker.sh
1614
all:
File renamed without changes.

scripts/build.sh

+20-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
set -e
44

5-
65
# Find the directory we exist within
76
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
87
cd ${DIR}/..
@@ -24,13 +23,23 @@ rm -rf $BUILDDIR/*
2423
# disable cgo
2524
export CGO_ENABLED=0
2625

27-
OUTPUT=$BUILDDIR/metrictank
28-
29-
if [ "$1" == "-race" ]
30-
then
31-
set -x
32-
go build -race -ldflags "-X main.gitHash=$GITVERSION" -o $OUTPUT
33-
else
34-
set -x
35-
go build -ldflags "-X main.gitHash=$GITVERSION" -o $OUTPUT
36-
fi
26+
function fail () {
27+
echo "Aborting due to failure." >&2
28+
exit 2
29+
}
30+
31+
# Build binary
32+
cd cmd
33+
for bin in *; do
34+
cd $bin
35+
if [ "$1" == "-race" ]
36+
then
37+
set -x
38+
CGO_ENABLED=1 go build -race -ldflags "-X main.gitHash=$GITVERSION" -o $BUILDDIR/$bin || fail
39+
else
40+
set -x
41+
go build -ldflags "-X main.gitHash=$GITVERSION" -o $BUILDDIR/$bin || fail
42+
fi
43+
set +x
44+
cd ..
45+
done

scripts/build_tools.sh

-34
This file was deleted.

0 commit comments

Comments
 (0)