-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (52 loc) · 1.31 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# general
VERSION = $(shell ./version.sh)
PRE-VERSION := $(shell grep 'Current' README.md | tr -d '***' | rev |cut -c 1-7 | rev)
NAME = dntk
TARGET = $(NAME)
DOCKER_REPO = nnao45
LINUX_TERM_LIB = linux_unknown.rs
$(TARGET):
cargo build --release
.PHONY: version
version:
@echo $(VERSION)
.PHONY: run
run:
cargo run --release
.PHONY: test
test:
cargo test
.PHONY: clean
clean:
cargo clean
.PHONY: docker-login
docker-login:
echo ${DOCKERHUB_PASSWORD} | docker login -u nnao45 --password-stdin
.PHONY: docker-build
docker-build:
docker rmi -f $(DOCKER_REPO)/$(TARGET):latest
docker build -t $(DOCKER_REPO)/$(TARGET):latest .
docker tag $(DOCKER_REPO)/$(TARGET):latest $(DOCKER_REPO)/$(TARGET):$(VERSION)
.PHONY: docker-push
docker-push:
docker push $(DOCKER_REPO)/$(NAME):latest
docker push $(DOCKER_REPO)/$(NAME):$(VERSION)
.PHONY: docker-release
docker-release: docker-build docker-push
.PHONY: git-release
git-release:
git add .
git commit -m "release $(VERSION)"
git tag -a $(VERSION) -m "release $(VERSION)"
git push origin $(VERSION)
.PHONY: cargo-release
cargo-release:
cargo publish
.PHONY: readme-upde
readme-upde:
sed -i '' -e 's/$(PRE-VERSION)/$(VERSION)/g' README.md
.PHONY: toml-upde
toml-upde:
@./release.sh
.PHONY: release
release: toml-upde readme-upde git-release cargo-release docker-release