Skip to content

Commit

Permalink
Add 'main' build target for dkron binaries (#973)
Browse files Browse the repository at this point in the history
Introduce rebuilding intermediates when changed
Colorize test output
  • Loading branch information
yvanoers committed May 29, 2021
1 parent 858ec29 commit 426c8a3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
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")/''

0 comments on commit 426c8a3

Please sign in to comment.