Skip to content

Commit

Permalink
Merge pull request #1 from hashicorp/fe-build-tags
Browse files Browse the repository at this point in the history
Add Make rules to build/test pro and enterprise
  • Loading branch information
dadgar committed Aug 17, 2017
2 parents 54d5f5d + 09d581b commit cad5e3e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
17 changes: 17 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,14 @@ TEST_TOOLS=\

all: test

dev: export GOTAGS=ent
dev: format generate
@scripts/build-dev.sh

prodev: export GOTAGS=pro
prodev: format generate
@scripts/build-dev.sh

bin: generate
@sh -c "'$(PWD)/scripts/build.sh'"

Expand All @@ -24,7 +29,19 @@ cov:
gocov test ./... | gocov-html > /tmp/coverage.html
open /tmp/coverage.html

test: export GOTAGS=ent
test: generate
GOTAGS="ent"
@echo "--> Running go fmt" ;
@if [ -n "`go fmt ${PACKAGES}`" ]; then \
echo "[ERR] go fmt updated formatting. Please commit formatted code first."; \
exit 1; \
fi
@sh -c "'$(PWD)/scripts/test.sh'"
@$(MAKE) vet

protest: export GOTAGS=pro
protest: generate
@echo "--> Running go fmt" ;
@if [ -n "`go fmt ${PACKAGES}`" ]; then \
echo "[ERR] go fmt updated formatting. Please commit formatted code first."; \
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GIT_COMMIT="$(git rev-parse HEAD)"
GIT_DIRTY="$(test -n "`git status --porcelain`" && echo "+CHANGES" || true)"
LDFLAG="github.com/hashicorp/nomad/version.GitCommit=${GIT_COMMIT}${GIT_DIRTY}"

TAGS="nomad_test"
TAGS="nomad_test $GOTAGS"
if [[ $(uname) == "Linux" ]]; then
if pkg-config --exists lxc; then
TAGS="$TAGS lxc"
Expand Down
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e

GOTEST_TAGS="nomad_test"
GOTEST_TAGS="nomad_test $GOTAGS"
if [[ $(uname) == "Linux" ]]; then
if pkg-config --exists lxc; then
GOTEST_TAGS="$GOTEST_TAGS lxc"
Expand Down

0 comments on commit cad5e3e

Please sign in to comment.