-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
37 lines (28 loc) · 896 Bytes
/
Makefile
File metadata and controls
37 lines (28 loc) · 896 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
35
36
37
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
EXE := upload
PKG := github.com/versus/gouploadservice
VER := 0.0.2
current_dir := $(shell pwd)
.PHONY: test
test:
go test -v ./...
.PHONY: run
run:
go run main.go
.PHONY:darwin linux
darwin linux:
GOOS=$@ CGO_ENABLED=0 GO111MODULE=on go build -o ./dist/$(EXE)-$(VER)-$@-$(GOARCH) $(PKG)
.PHONY: clean
clean:
rm -rf ./dist/
.PHONY: docker-build
docker-build:
docker build -f Dockerfile -t versus/go-upload:latest .
.PHONY: docker-run
docker-run:
docker-compose -f docker-compose.yml up --build
.PHONY: docker-test
docker-test:
cd terratest && go test -v -timeout 30m
pwd && docker run --rm -v $(current_dir)/goss.yaml:/goss.yaml -v /var/run/docker.sock:/var/run/docker.sock -e GOSS_FILES_STRATEGY=cp versus197/dgoss-docker-image:latest /usr/local/bin/dgoss run --entrypoint=/dgoss/start.sh versus/go-upload:test