2021-01-08 17:16:00 +01:00
|
|
|
.PHONY: all
|
|
|
|
all: dagger
|
|
|
|
|
2020-12-30 03:45:16 +01:00
|
|
|
.PHONY: dagger
|
2021-02-12 23:37:41 +01:00
|
|
|
dagger:
|
2021-05-28 20:36:21 +02:00
|
|
|
CGO_ENABLED=0 go build -o ./cmd/dagger/ -ldflags '-s -w' ./cmd/dagger/
|
2021-01-08 17:16:00 +01:00
|
|
|
|
2021-05-28 00:52:30 +02:00
|
|
|
.PHONY: dagger-debug
|
2021-02-12 23:37:41 +01:00
|
|
|
dagger-debug:
|
2021-01-21 03:44:29 +01:00
|
|
|
go build -race -o ./cmd/dagger/dagger-debug ./cmd/dagger/
|
|
|
|
|
2021-01-14 03:21:56 +01:00
|
|
|
.PHONY: test
|
|
|
|
test:
|
2021-01-21 03:44:29 +01:00
|
|
|
go test -race -v ./...
|
2021-01-14 03:21:56 +01:00
|
|
|
|
2021-04-02 23:15:49 +02:00
|
|
|
.PHONY: golint
|
|
|
|
golint:
|
|
|
|
golangci-lint run --timeout 3m
|
|
|
|
|
2021-01-08 17:16:00 +01:00
|
|
|
.PHONY: cuefmt
|
|
|
|
cuefmt:
|
2021-05-27 03:45:11 +02:00
|
|
|
@(find . -name '*.cue' -exec cue fmt -s {} \;)
|
2021-01-08 17:16:00 +01:00
|
|
|
|
2021-04-02 23:15:49 +02:00
|
|
|
.PHONY: cuelint
|
|
|
|
cuelint: cuefmt
|
2021-01-08 17:29:06 +01:00
|
|
|
@test -z "$$(git status -s . | grep -e "^ M" | grep .cue | cut -d ' ' -f3 | tee /dev/stderr)"
|
2021-01-14 22:50:54 +01:00
|
|
|
|
2021-04-14 23:47:46 +02:00
|
|
|
.PHONY: shellcheck
|
|
|
|
shellcheck:
|
|
|
|
shellcheck ./tests/*.bats ./tests/*.bash
|
|
|
|
|
2021-04-02 23:15:49 +02:00
|
|
|
.PHONY: lint
|
2021-06-09 03:57:45 +02:00
|
|
|
lint: shellcheck cuelint golint check-buildkit-version docslint
|
2021-04-02 23:15:49 +02:00
|
|
|
|
2021-03-03 01:14:53 +01:00
|
|
|
.PHONY: check-buildkit-version
|
|
|
|
check-buildkit-version:
|
|
|
|
@test \
|
|
|
|
"$(shell grep buildkit ./go.mod | cut -d' ' -f2)" = \
|
2021-05-26 01:53:26 +02:00
|
|
|
"$(shell grep ' = "v' ./util/buildkitd/buildkitd.go | sed -E 's/^.*version.*=.*\"(v.*)\"/\1/' )" \
|
|
|
|
|| { echo buildkit version mismatch go.mod != util/buildkitd/buildkitd.go ; exit 1; }
|
2021-03-03 01:14:53 +01:00
|
|
|
|
2021-01-14 22:50:54 +01:00
|
|
|
.PHONY: integration
|
2021-01-21 03:44:29 +01:00
|
|
|
integration: dagger-debug
|
2021-05-12 00:03:15 +02:00
|
|
|
$(shell command -v sops > /dev/null || { echo "You need sops. On macOS: brew install sops"; exit 1; })
|
|
|
|
$(shell command -v parallel > /dev/null || { echo "You need gnu parallel. On macOS: brew install parallel"; exit 1; })
|
2021-04-14 23:47:46 +02:00
|
|
|
yarn --cwd "./tests" install
|
|
|
|
DAGGER_BINARY="../cmd/dagger/dagger-debug" yarn --cwd "./tests" test
|
2021-03-03 03:59:07 +01:00
|
|
|
|
2021-04-04 01:42:29 +02:00
|
|
|
.PHONY: install
|
|
|
|
install: dagger
|
|
|
|
go install ./cmd/dagger
|
2021-06-02 23:06:48 +02:00
|
|
|
|
2021-06-09 03:57:45 +02:00
|
|
|
.PHONY: docs
|
|
|
|
docs: dagger
|
2021-06-09 02:35:18 +02:00
|
|
|
./cmd/dagger/dagger doc --output ./docs/reference/universe --format md
|
|
|
|
|
2021-06-09 03:57:45 +02:00
|
|
|
.PHONY: docslint
|
|
|
|
docslint: docs
|
2021-06-09 02:35:18 +02:00
|
|
|
@test -z "$$(git status -s . | grep -e "^ M" | grep docs/reference/universe | cut -d ' ' -f3 | tee /dev/stderr)"
|
|
|
|
|
2021-06-09 03:57:45 +02:00
|
|
|
.PHONY: web
|
|
|
|
web:
|
2021-06-04 22:28:38 +02:00
|
|
|
yarn --cwd "./website" install
|
|
|
|
yarn --cwd "./website" start
|