-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
37 lines (32 loc) · 918 Bytes
/
Makefile
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
# Release the given VERSION
MDCLOUD_GO_VERSION=1.2.0
release:
ifndef VERSION
$(error VERSION is not set)
endif
@echo "releasing $(VERSION)"
@echo "building"
# TODO: git release
@$(MAKE) build
.PHONY: release
# Test all packages.
test:
@go test -cover ./...
.PHONY: test
# Build release binaries
# TODO: versioning based on tags
build:
ifndef VERSION
$(error VERSION is not set)
endif
# VERSION=$(git describe --abbrev=0 --tags --dirty="-$(git rev-parse --abbrev-ref HEAD)")
@docker run -e VERSION=$(VERSION) -v $(shell pwd):/go/src/github.com/OPSWAT/mdcloud-go --rm opswat/mdcloud-go:$(MDCLOUD_GO_VERSION) /go/src/github.com/OPSWAT/mdcloud-go/build.sh
.PHONY: build
# Build docker image
image:
ifndef VERSION
$(error VERSION is not set)
endif
@docker build --build-arg VERSION=$(VERSION) -t opswat/mdcloud-go:$(VERSION) -f "./image.dockerfile" .
# @docker push opswat/mdcloud-go:$(VERSION)
.PHONY: image