-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
46 lines (34 loc) · 877 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
38
39
40
41
42
43
44
45
46
# Executable name
OUT := SLALite
# Package name
PKG := SLALite
# e.g. mf2c/sla-management
IMAGE := mf2c/sla-management
# Version identifier for HEAD
VERSION := $(shell git describe --always --dirty)
DATE := $(shell date -u +%Y-%m-%dT%H:%M:%S)
all: run
build:
go build -i -v -o ${OUT} -ldflags="-X main.version=${VERSION} -X main.date=${DATE}" ${PKG}
test:
go test ./...
run: build
./${OUT}
docker:
resources/bin/make_docker.sh ${IMAGE}
release_patch:
resources/bin/release.sh patch
release_minor:
resources/bin/release.sh minor
release_major:
resources/bin/release.sh major
release: clean test apigen
resources/bin/xrelease.sh
resources/bin/make_docker.sh ${IMAGE}
clean:
go clean
go clean -cache
-@rm ${OUT} ${OUT}-v*
apigen:
swagger generate spec -m -o resources/swagger.json
.PHONY: build run docker release_patch release_minor release_major clean