forked from SUSE/zypper-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (61 loc) · 1.84 KB
/
Makefile
File metadata and controls
76 lines (61 loc) · 1.84 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
test :: checks unit_test test_integration
unit_test :: build
docker run --rm -v `pwd`:/go/src/github.com/SUSE/zypper-docker zypper-docker /opt/test.sh
test_integration :: build_zypper_docker build_integration_tests
# docker run \
# --rm \
# --volume="/var/run/docker.sock:/var/run/docker.sock" \
# --volume="$(CURDIR):/code" \
# zypper-docker-integration-tests \
# rake test
# Run only the RSpec tests flagged as 'quick', does NOT build the zypper-docker
# binary or the testing images
# Note well: "docker -ti" is required to use byebug inside of the ruby tests
test_integration_quick ::
# docker run \
# --rm \
# -ti \
# --volume="/var/run/docker.sock:/var/run/docker.sock" \
# --volume="$(CURDIR):/code" \
# zypper-docker-integration-tests \
# rspec -t quick
checks :: vet fmt lint gotest climate
vet ::
@echo "+ $@"
@go vet .
fmt ::
@echo "+ $@"
@test -z "$$(gofmt -l . | grep -v vendor | tee /dev/stderr)" || \
echo "+ please format Go code with 'gofmt'"
lint ::
@echo "+ $@"
@test -z "$$(golint . | grep -v vendor | tee /dev/stderr)"
climate:
@echo "+ $@"
@(./scripts/climate -o -p -a .)
# TODO: use '-race' once it works in openSUSE's golang
gotest:
@echo "+ $@"
@go test
clean ::
docker rmi zypper-docker
docker rmi zypper-docker-integration-tests
rm -f zypper-docker
rm -f man/man1
man ::
@ cd man && go run generate.go
build ::
@echo Building zypper-docker
docker build -f docker/Dockerfile -t zypper-docker docker
build_zypper_docker ::
go build
build_integration_tests ::
@echo Building zypper-docker-integration-tests
docker build -f docker/Dockerfile-integration-tests -t zypper-docker-integration-tests $(CURDIR)
help ::
@echo usage: make [target]
@echo
@echo build: Creates the dockerimage.
@echo clean: Remove the dockerimage.
@echo test: Testing zypper-docker.
@echo test_intetgration: Integration Tests