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

move metrictank.go to cmd directory #935

Merged
merged 1 commit into from
Jun 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ jobs:
steps:
- checkout
- run: scripts/build.sh
- run: scripts/build_tools.sh
- setup_remote_docker
- run: scripts/build_docker.sh
- run: mkdir build_docker
Expand Down Expand Up @@ -37,7 +36,7 @@ jobs:
- run: scripts/qa/go-generate.sh
- run: scripts/qa/ineffassign.sh
- run: scripts/qa/misspell.sh
- run: scripts/qa/tools_gitignore.sh
- run: scripts/qa/gitignore.sh
- run: scripts/qa/unused.sh
- run: scripts/qa/vendor.sh

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.*.sw?
.notouch
build/
/metrictank
/cmd/metrictank/metrictank
/cmd/mt-aggs-explain/mt-aggs-explain
/cmd/mt-explain/mt-explain
/cmd/mt-index-cat/mt-index-cat
Expand Down
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ check:
$(MAKE) test
bin:
./scripts/build.sh
./scripts/build_tools.sh
bin-race:
./scripts/build.sh -race
./scripts/build_tools.sh -race
docker:
./scripts/build_docker.sh
all:
Expand Down
File renamed without changes.
31 changes: 20 additions & 11 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

set -e


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

OUTPUT=$BUILDDIR/metrictank

if [ "$1" == "-race" ]
then
set -x
go build -race -ldflags "-X main.gitHash=$GITVERSION" -o $OUTPUT
else
set -x
go build -ldflags "-X main.gitHash=$GITVERSION" -o $OUTPUT
fi
function fail () {
echo "Aborting due to failure." >&2
exit 2
}

# Build binary
cd cmd
for bin in *; do
cd $bin
if [ "$1" == "-race" ]
then
set -x
CGO_ENABLED=1 go build -race -ldflags "-X main.gitHash=$GITVERSION" -o $BUILDDIR/$bin || fail
else
set -x
go build -ldflags "-X main.gitHash=$GITVERSION" -o $BUILDDIR/$bin || fail
fi
set +x
cd ..
done
34 changes: 0 additions & 34 deletions scripts/build_tools.sh

This file was deleted.

6 changes: 3 additions & 3 deletions scripts/qa/tools_gitignore.sh → scripts/qa/gitignore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ file=../.gitignore
# NOTE: known limitation: does not clean up stale gitignore rules

declare -a missing
for tool in *; do
rule="/cmd/$tool/$tool"
for bin in *; do
rule="/cmd/$bin/$bin"
grep -q "^$rule$" $file || missing=("${missing[@]}" "$rule")
done

Expand All @@ -20,4 +20,4 @@ if [ ${#missing[@]} -gt 0 ]; then
exit 2
fi

echo "gitignore rules for all tools found"
echo "gitignore rules for all binaries found"