-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
144 lines (117 loc) · 3.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
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
package=bar
pyenv=ENV2
UNAME=$(shell uname)
export ROOT_DIR=${PWD}/cloudmesh/rest/server
MONGOD=mongod --dbpath ~/.cloudmesh/data/db --bind_ip 127.0.0.1
EVE=cd $(ROOT_DIR); $(pyenv); python service.py
VERSION=`head -1 VERSION`
define banner
@echo
@echo "###################################"
@echo $(1)
@echo "###################################"
endef
ifeq ($(UNAME),Darwin)
define terminal
osascript -e 'tell application "Terminal" to do script "$(1)"'
endef
endif
ifeq ($(UNAME),Linux)
define terminal
echo "Linux not yet supported, fix me"
endef
endif
ifeq ($(UNAME),Windows)
define terminal
echo "Windows not yet supported, fix me"
endef
endif
setup:
# brew update
# brew install mongodb
# brew install jq
rm -rf ~/.cloudmesh/data/db
mkdir -p ~/.cloudmesh/data/db
kill:
killall mongod
mongo:
$(call terminal, $(MONGOD))
eve:
$(call terminal, $(EVE))
source:
python setup.py install; pip install -e .
cms help
test:
$(call banner, "LIST SERVICE")
curl -s -i http://127.0.0.1:5000
$(call banner, "LIST PROFILE")
@curl -s http://127.0.0.1:5000/profile | jq
$(call banner, "LIST CLUSTER")
@curl -s http://127.0.0.1:5000/cluster | jq
$(call banner, "LIST COMPUTER")
@curl -s http://127.0.0.1:5000/computer | jq
$(call banner, "INSERT COMPUTER")
curl -d '{"name": "myCLuster", "label": "c0","ip": "127.0.0.1","memoryGB": 16}' -H 'Content-Type: application/json' http://127.0.0.1:5000/computer
$(call banner, "LIST COMPUTER")
@curl -s http://127.0.0.1:5000/computer | jq
nosetests:
nosetests -v --nocapture tests/test_mongo.py
clean:
rm -rf *.zip
rm -rf *.egg-info
rm -rf *.eggs
rm -rf docs/build
rm -rf build
rm -rf dist
find . -name '__pycache__' -delete
find . -name '*.pyc' -delete
find . -name '*.pye' -delete
rm -rf .tox
rm -f *.whl
genie:
git clone https://github.com/drud/evegenie.git
cd evegenie; pip install -r requirements.txt
json:
python evegenie/geneve.py sample.json
cp sample.settings.py $(ROOT_DIR)/settings.py
cat $(ROOT_DIR)/settings.py
install:
cd ../common; python setup.py install; pip install .
cd ../cmd5; python setup.py install; pip install .
python setup.py install; pip install .
######################################################################
# PYPI - Only to be exectued by Gregor
######################################################################
twine:
pip install twine
dist: twine clean
@echo "######################################"
@echo "# $(VERSION)"
@echo "######################################"
python setup.py sdist --formats=gztar,zip
python setup.py bdist
python setup.py bdist_wheel
upload_test:
python setup.py sdist bdist bdist_wheel upload -r https://testpypi.python.org/pypi
log:
gitchangelog | fgrep -v ":dev:" | fgrep -v ":new:" > ChangeLog
git commit -m "chg: dev: Update ChangeLog" ChangeLog
git push
register: dist
@echo "######################################"
@echo "# $(VERSION)"
@echo "######################################"
twine register dist/cloudmesh.$(package)-$(VERSION)-py2.py3-none-any.whl
twine register dist/cloudmesh.$(package)-$(VERSION).macosx-10.12-x86_64.tar.gz
twine register dist/cloudmesh.$(package)-$(VERSION).tar.gz
twine register dist/cloudmesh.$(package)-$(VERSION).zip
upload: dist
twine upload dist/*
#
# GIT
#
tag:
touch README.rst
git tag $(VERSION)
git commit -a -m "$(VERSION)"
git push