|
|
@@ -1,27 +1,11 @@
|
|
|
-GOOS ?= $(shell go env GOOS)
|
|
|
-GOARCH ?= $(shell go env GOARCH)
|
|
|
-PWD = $(shell pwd)
|
|
|
-
|
|
|
-export DOCKER_BUILDKIT=1
|
|
|
-
|
|
|
-.DEFAULT_GOAL := build
|
|
|
-
|
|
|
-build: ## Build for the current
|
|
|
- @docker build . \
|
|
|
- --output type=local,dest=./dist \
|
|
|
- --build-arg TARGET_OS=${GOOS} \
|
|
|
- --build-arg TARGET_ARCH=${GOARCH} \
|
|
|
- --target build
|
|
|
+clean:
|
|
|
+ rm -rf dist/
|
|
|
|
|
|
-cross: ## Cross build for linux, macos and windows
|
|
|
- @docker build . \
|
|
|
- --output type=local,dest=./dist \
|
|
|
- --target cross
|
|
|
+build:
|
|
|
+ go build -v -o dist/docker-ecs cmd/main/main.go
|
|
|
|
|
|
test: build ## Run tests
|
|
|
- @docker build . \
|
|
|
- --output type=local,dest=./dist \
|
|
|
- --target test
|
|
|
+ go test ./... -v
|
|
|
|
|
|
e2e: build ## Run tests
|
|
|
go test ./... -v -tags=e2e
|
|
|
@@ -31,13 +15,6 @@ dev: build
|
|
|
ln -f -s "${PWD}/dist/docker-ecs" "${HOME}/.docker/cli-plugins/docker-ecs"
|
|
|
|
|
|
lint: ## Verify Go files
|
|
|
- @docker run --rm -t \
|
|
|
- -v $(PWD):/app \
|
|
|
- -w /app \
|
|
|
- golangci/golangci-lint:v1.27-alpine \
|
|
|
- golangci-lint run --timeout 10m0s --config ./golangci.yaml ./...
|
|
|
-
|
|
|
-clean:
|
|
|
- rm -rf dist/
|
|
|
+ golangci-lint run --config ./golangci.yaml ./...
|
|
|
|
|
|
-.PHONY: clean build test dev lint e2e cross
|
|
|
+.PHONY: clean build test dev lint e2e
|