Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build target + improve test output #973

Merged
merged 1 commit into from
May 29, 2021
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
24 changes: 22 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@ clean:
rm -f *.rpm
rm -f *.tar.gz
rm -rf tmp
rm -rf ui-dist
rm -rf ui/build
rm -rf ui/node_modules
GOBIN=`pwd` go clean -i ./builtin/...
GOBIN=`pwd` go clean

.PHONY: doc apidoc gen test ui
.PHONY: doc apidoc test ui updatetestcert
doc:
#scripts/run doc --dir website/content/cli
cd website; hugo -d ../public
Expand All @@ -47,5 +52,20 @@ updatetestcert:
openssl pkcs12 -in badssl.com-client.p12 -nokeys -passin pass:badssl.com -out builtin/bins/dkron-executor-http/testdata/badssl.com-client.pem
rm badssl.com-client.p12

ui:
ui/node_modules: ui/package.json
cd ui; npm install
# touch the directory so Make understands it is up to date
touch ui/node_modules

dkron/ui-dist: ui/node_modules ui/public/* ui/src/* ui/src/*/*
cd ui; npm run-script build

plugin/types/%.pb.go: proto/%.proto
protoc -I proto/ --go_out=plugin/types --go_opt=paths=source_relative --go-grpc_out=plugin/types --go-grpc_opt=paths=source_relative $<

ui: dkron/ui-dist

main: dkron/ui-dist plugin/types/dkron.pb.go plugin/types/executor.pb.go *.go */*.go */*/*.go */*/*/*.go
GOBIN=`pwd` go install ./builtin/...
go mod tidy
go build main.go
2 changes: 1 addition & 1 deletion scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -e
docker build -t dkron .
docker run dkron scripts/validate-gofmt
docker run dkron go vet
docker run --rm dkron go test -v ./... $1
docker run --rm dkron go test -v ./... $1 | sed ''/PASS/s//$(printf "\033[32mPASS\033[0m")/'' | sed ''/FAIL/s//$(printf "\033[31mFAIL\033[0m")/''