2021-07-19 17:43:45 +02:00
|
|
|
GIT_REVISION := $(shell git rev-parse --short HEAD)
|
|
|
|
|
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-07-19 17:43:45 +02:00
|
|
|
CGO_ENABLED=0 go build -o ./cmd/dagger/ -ldflags '-s -w -X go.dagger.io/dagger/version.Revision=$(GIT_REVISION)' ./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-07-19 17:43:45 +02:00
|
|
|
go build -race -o ./cmd/dagger/dagger-debug -ldflags '-X go.dagger.io/dagger/version.Revision=$(GIT_REVISION)' ./cmd/dagger/
|
2021-01-21 03:44:29 +01:00
|
|
|
|
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-06-10 00:46:55 +02:00
|
|
|
shellcheck ./universe/*.bats ./universe/*.bash
|
2021-04-14 23:47:46 +02:00
|
|
|
|
2021-04-02 23:15:49 +02:00
|
|
|
.PHONY: lint
|
2021-07-19 16:26:18 +02:00
|
|
|
lint: shellcheck cuelint golint docslint
|
2021-03-03 01:14:53 +01:00
|
|
|
|
2021-01-14 22:50:54 +01:00
|
|
|
.PHONY: integration
|
2021-07-01 18:47:32 +02:00
|
|
|
integration: core-integration universe-test
|
|
|
|
|
|
|
|
.PHONY: core-integration
|
|
|
|
core-integration: dagger-debug
|
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-06-09 21:08:03 +02:00
|
|
|
.PHONY: universe-test
|
|
|
|
universe-test: dagger-debug
|
|
|
|
yarn --cwd "./universe" install
|
|
|
|
DAGGER_BINARY="../cmd/dagger/dagger-debug" yarn --cwd "./universe" test
|
|
|
|
|
2021-08-12 12:47:50 +02:00
|
|
|
.PHONY: doc-test
|
|
|
|
doc-test: dagger-debug
|
|
|
|
yarn --cwd "./docs/learn/tests" install
|
|
|
|
DAGGER_BINARY="$(shell pwd)/cmd/dagger/dagger-debug" yarn --cwd "./docs/learn/tests" test
|
|
|
|
|
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
|