-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
158 lines (117 loc) · 4.03 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
TEST_DIR=$(CURDIR)/test
RESOURCES_DIR=$(CURDIR)/resources
PEP8=pep8 --ignore=E501,E225,E123,E128
VERSION_FULL:=$(shell grep "VERSION = '.*'" proso/release.py | awk -F ' = ' '{print $$2}' | tr -d "'")
VERSION:=$(shell echo $(VERSION_FULL) | awk -F '-' '{print $$1}')
VERSION_SUFFIX:=$(shell echo $(VERSION_FULL) | awk -F '-' '{print $$2}')
MAJOR_VERSION=$(word 1,$(subst ., ,$(VERSION)))
MINOR_VERSION=$(word 2,$(subst ., ,$(VERSION)))
MICRO_VERSION=$(word 3,$(subst ., ,$(VERSION)))
################################################################################
upload: reinstall grunt register
python setup.py sdist upload
register:
python setup.py register
################################################################################
docker-pull:
docker-compose pull
docker-up: docker-pull
docker-compose up
docker-bash: docker-pull
docker-compose run --rm proso-apps bash
docker-tests: docker-pull
docker-compose run --rm proso-apps bash -c "cd /proso-apps && make test"
sphinx-apidoc:
sphinx-apidoc -o docs/ref . `find . -name test_*.py -or -name *test.py -or -name migrations -or -name management -or -name setup.py -or -name testproject -or -name manage.py`
doctest:
cd docs; $(MAKE) doctest
unittest:
python -m unittest discover -p test_*.py -s proso;
django-test:
python manage.py test --traceback --pattern *_test.py;
test: unittest django-test
reinstall: check uninstall install
develop-js:
rm -rf testproject/bower_components/proso-apps-js; \
ln -s ../../../proso-apps-js/dist testproject/bower_components/proso-apps-js;
develop: check
python setup.py develop
bower:
cd testproject; bower install -f
bower-develop: bower develop-js
grunt:
cd testproject; grunt
build-js: bower grunt
build-js-develop: bower-develop grunt
install: check
python setup.py sdist
pip install dist/proso-apps-$(VERSION_FULL)*
uninstall:
pip uninstall --yes proso-apps
check:
pip install flake8
flake8 --ignore=E501,E225,E123,E128,W503,E731 --exclude=*/migrations/*.py,*/static/bower_components,setup.py,docs/conf.py,.ropeproject,.eggs .
################################################################################
release-micro:
$(MAKE) milestone; \
$(MAKE) upload; \
$(MAKE) increase-micro; \
$(MAKE) snapshot; \
git add proso/release.py; \
$(MAKE) commit-start-working; \
git push;
release:
$(MAKE) milestone; \
$(MAKE) upload; \
$(MAKE) create-minor-branch; \
git checkout master; \
$(MAKE) increase-minor; \
$(MAKE) snapshot; \
git add proso/release.py; \
$(MAKE) commit-start-working; \
git push;
milestone:
MAJOR=$(MAJOR_VERSION); \
MINOR=$(MINOR_VERSION); \
MICRO=$(MICRO_VERSION); \
sed -i "s/VERSION = '.*'/VERSION = '$${MAJOR}.$${MINOR}.$${MICRO}'/g" proso/release.py; \
$(MAKE) publish-version; \
create-minor-branch:
MAJOR=$(MAJOR_VERSION); \
MINOR=$(MINOR_VERSION); \
git checkout -b master-$${MAJOR}.$${MINOR}.X; \
$(MAKE) increase-micro; \
$(MAKE) snapshot; \
git add proso/release.py; \
$(MAKE) commit-start-working; \
git push origin master-$${MAJOR}.$${MINOR}.X
commit-back-to-snapshot:
git commit -m 'back to $(VERSION_FULL)'; \
commit-start-working:
git commit -m 'start working on $(VERSION)'; \
snapshot:
MAJOR=$(MAJOR_VERSION); \
MINOR=$(MINOR_VERSION); \
MICRO=$(MICRO_VERSION); \
sed -i "s/VERSION = '.*'/VERSION = '$${MAJOR}.$${MINOR}.$${MICRO}.dev'/g" proso/release.py; \
publish-version:
git reset
git add proso/release.py
git commit -m 'release a new version $(VERSION_FULL)'
git tag release-$(VERSION_FULL)
git push origin release-$(VERSION_FULL)
increase-major:
MAJOR=`expr $(MAJOR_VERSION) + 1`; \
MINOR=0; \
MICRO=0; \
sed -i "s/VERSION = '.*'/VERSION = '$${MAJOR}.$${MINOR}.$${MICRO}'/g" proso/release.py; \
increase-minor:
MAJOR=$(MAJOR_VERSION); \
MINOR=`expr $(MINOR_VERSION) + 1`; \
MICRO=0; \
sed -i "s/VERSION = '.*'/VERSION = '$${MAJOR}.$${MINOR}.$${MICRO}'/g" proso/release.py;
increase-micro:
MAJOR=$(MAJOR_VERSION); \
MINOR=$(MINOR_VERSION); \
MICRO=`expr $(MICRO_VERSION) + 1`; \
sed -i "s/VERSION = '.*'/VERSION = '$${MAJOR}.$${MINOR}.$${MICRO}'/g" proso/release.py;