-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
159 lines (130 loc) · 4.09 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
package=cyberaide-bookmanager
VERSION=$(shell head -1 VERSION)
CM=$(shell dirname `pwd`)
.PHONY: readme
#source:
# cd ../cloudmesh.common; make source
# $(call banner, "Install cloudmesh-cmd5")
# pip install -e . -U
# cms help
validate:
gem install travis
travis lint .travis.yml
clean:
@echo "############################################################"
@echo "# CLEAN "
@echo "############################################################"
rm -rf dist
rm -rf *.zip
rm -rf *.egg-info
rm -rf *.eggs
rm -rf docs/build
rm -rf build
find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
rm -rf .tox
rm -f *.whl
readme:
bookmanager --help > README-helper/manual.md
cat README-prefix.md \
README-helper/verbatim-start.md \
README-helper/manual.md \
README-helper/verbatim-stop.md \
README-postfix.md \
README-helper/verbatim-start.md \
tests/python.yml \
README-helper/verbatim-stop.md \
README-install-other.md > README.md
git commit -am "Generating the README"
git push
######################################################################
# PYPI
######################################################################
twine:
pip install -U twine
dist:
python setup.py sdist bdist_wheel
twine check dist/*
requirements_dev:
pip install -r requirements-dev.txt
patch: clean requirements_dev
@echo "############################################################"
@echo "# BUILD "
@echo "############################################################"
bump2version --no-tag patch
python setup.py sdist
python setup.py bdist_wheel
git push
# git push origin main --tags
twine check dist/*
twine upload --repository testpypi dist/*
# $(call banner, "install")
# sleep 10
# pip install --index-url https://test.pypi.org/simple/ cloudmesh-$(package) -U
minor: clean
@echo "############################################################"
@echo "# MINOR "
@echo "############################################################"
bump2version minor --allow-dirty
@cat VERSION
@echo
release: clean
@echo "############################################################"
@echo "# CLEAN "
@echo "############################################################"
git tag "v$(VERSION)"
git push origin main --tags
python setup.py sdist bdist_wheel
twine check dist/*
twine upload --repository pypi dist/*
$(call banner, "install")
@cat VERSION
@echo
# sleep 10
# pip install -U cyberaide-common
make -f Makefile image
make -f Makefile push
dev:
bump2version --new-version "$(VERSION)-dev0" part --allow-dirty
bump2version patch --allow-dirty
@cat VERSION
@echo
reset:
bump2version --new-version "4.0.0-dev0" part --allow-dirty
upload:
twine check dist/*
twine upload dist/*
pip:
pip install --index-url https://test.pypi.org/simple/ cyberaide-$(package) -U
# --extra-index-url https://test.pypi.org/simple
log:
@echo "############################################################"
@echo "# LOG "
@echo "############################################################"
gitchangelog | fgrep -v ":dev:" | fgrep -v ":new:" > ChangeLog
git commit -m "chg: dev: Update ChangeLog" ChangeLog
git push
######################################################################
# DOCKER
######################################################################
#--no-cache=true
image:
docker build -t cloudmesh/bookmanager:${VERSION} -t cloudmesh/bookmanager:latest .
@echo Size: `docker inspect -f "{{ .Size }}" cloudmesh/bookmanager | numfmt --to=si`
#
# cm mounts all ./* directories into the container
#
shell:
docker run -v $(CM):/cm -w /cm --rm -it cloudmesh/bookmanager:${VERSION} /bin/bash
winshell:
winpty docker run -v $(CM):/cm -w /cm --rm -it cloudmesh/bookmanager:${VERSION} /bin/bash
cms:
docker run --rm -it cloudmesh/bookmanager:${VERSION}
dockerclean:
-docker kill $$(docker ps -q) --force
-docker rm $$(docker ps -a -q) --force
-docker rmi $$(docker images -q) --force
push:
docker push cloudmesh/bookmanager:${VERSION}
docker push cloudmesh/bookmanager:latest
run:
docker run cloudmesh/bookmanager:${VERSION} /bin/sh -c "cd books/book/cloud; git pull; make"