-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (27 loc) · 967 Bytes
/
Makefile
File metadata and controls
34 lines (27 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
.PHONY: build install test test-ci lint lint-fix fmt
build:
mkdir -p bin
go build -ldflags "-X main.version=dev \
-X main.gitCommit=$(shell git rev-parse --short HEAD 2>/dev/null || echo unknown) \
-X main.buildTime=$(shell date -u +%FT%TZ 2>/dev/null || echo unknown)" \
-o bin/docker-deploy ./cmd/docker-deploy/
install: build
mkdir -p $(HOME)/.docker/cli-plugins
install -m 755 bin/docker-deploy $(HOME)/.docker/cli-plugins/docker-deploy
test:
go test ./...
test-ci:
@if [ -S /var/run/docker.sock ]; then \
TESTCONTAINERS_RYUK_DISABLED=true \
go test -v -tags integration -timeout 15m ./integration/... ; \
else \
TESTCONTAINERS_RYUK_DISABLED=true \
DOCKER_HOST=unix://$(HOME)/.colima/default/docker.sock \
go test -v -tags integration -timeout 15m ./integration/... ; \
fi
lint:
golangci-lint run ./...
lint-fix:
golangci-lint run --fix ./...
fmt:
find . -name '*.go' | xargs goimports -w -local github.com/webcane/docker-deploy