-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
193 lines (132 loc) · 4.47 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
remote_addr=140.125.183.86
remote_user=mb201lab
server:
# export GRAILS_OPTS="-XX:MaxPermSize=1024m -Xmx1024M -server"
grails run-app
commit:
git commit . -m 'development update'
git push
update:
git pull
submoduleInstall:
git submodule init
git submodule update
# upload:
# scp target/extrails.war ${remote_user}@${remote_addr}:~/extrails/target/
# scp ~/.grails/extrails-config.groovy ${remote_user}@${remote_addr}:~/.grails/
# deploy:
# cp ~/.grails/extrails-config.groovy /usr/share/tomcat7/.grails/
# rm -rf /var/lib/tomcat7/webapps/ROOT.war
# rm -rf /var/lib/tomcat7/webapps/ROOT
# cp target/extrails.war /var/lib/tomcat7/webapps/ROOT.war
# service tomcat7 restart
remote-init:
ssh -t ${remote_user}@${remote_addr} 'sudo mkdir -p /usr/share/tomcat7/.grails \
&& sudo chgrp -R tomcat7 /usr/share/tomcat7 \
&& sudo chmod -R 770 /usr/share/tomcat7'
remote-dbinit:
sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql phpmyadmin libapache2-mod-php5
mysql -u root -p
CREATE DATABASE foodprint DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
create user 'foodprint'@'localhost' identified by 'foodprint';
grant all on *.* to 'foodprint'@'localhost';
# remote-deploy:
# ssh -t ${remote_user}@${remote_addr} 'cd extrails && make update && sudo make deploy'
# remote-log:
# ssh -t ${remote_user}@${remote_addr} 'cd extrails && sudo make log'
mysqldump:
mysqldump foodprint -u foodprint -p > foodprint.sql
rds_syncdb:
mysql -u foodprint -p -h foodprint.cfcjwz6dujwq.us-east-1.rds.amazonaws.com foodprint < foodprint.sql
syncdb:
mysql -u foodprint -p -h foodprint.ws foodprint < foodprint.sql
# services:
# mysqld_safe5 &
# rabbitmq-server &
clean:
grails clean
war:
grails war
runtest:
grails test-app
deployWar:
scp target/foodprint.war ${remote_user}@${remote_addr}:~/ROOT.war
ssh -t ${remote_user}@${remote_addr} \
'cd ~/ \
&& sudo rm -rf /foodprint/webapps/Catalina/ROOT \
&& sudo cp ROOT.war /foodprint/webapps/Catalina/ \
&& cd /docker-compose-agricloud \
&& docker-compose restart tomcat'
puploadWar:
scp target/foodprint.war pipi@${remote_addr}:~/ROOT.war
pdeployWar:
ssh -t pipi@${remote_addr} \
'cd ~/ \
&& sudo rm -rf /foodprint/webapps/Catalina/ROOT \
&& sudo cp ROOT.war /foodprint/webapps/Catalina/ \
&& cd /docker-compose-agricloud \
&& docker-compose restart tomcat'
deployConfig:
scp ~/.grails/foodprint-config.groovy ${remote_user}@${remote_addr}:~/
ssh -t ${remote_user}@${remote_addr} \
'sudo cp foodprint-config.groovy /usr/share/tomcat7/.grails/ \
&& sudo service tomcat7 restart'
done:
make extjs-done touch-done-testing clean runtest war deployWar
pdone:
make extjs-done touch-done-testing clean runtest war puploadWar pdeployWar
log:
ssh -t ${remote_user}@${remote_addr} 'docker logs -f --tail=100 tomcat'
install:
make remote-init done
code-analysis:
grails codenarc
code-coverage:
grails test-app -coverage
# extjs make file
extjs-create:
cd extjs-app && sencha -sdk extjs generate app foodprint
extjs-clean:
- rm -rf web-app/resources
- rm web-app/index.html
- rm -rf web-app/neptune-*
extjs-upgrade:
cd extjs-app && sencha app upgrade extjs
extjs-production:
cd extjs-app && sencha app build production
extjs-testing:
cd extjs-app && sencha app build testing
extjs-deploy:
rsync -a extjs-app/build/production/foodprint/ web-app/
rsync -a extjs-app/resources/ web-app/resources/
extjs-done:
make extjs-clean extjs-production extjs-deploy
# touch make file
touch-create:
cd touch-app && sencha -sdk touch generate app foodprintTouch
touch-upgrade:
cd touch-app && sencha app upgrade touch
touch-production:
cd touch-app && sencha app build production
touch-testing:
cd touch-app && sencha app build testing
touch-deploy-production:
rsync -a touch-app/build/production/foodprintTouch/ web-app/touch
touch-deploy-testing:
rsync -a touch-app/build/testing/foodprintTouch/ web-app/touch
touch-done:
make touch-production touch-deploy-production
touch-done-testing:
make touch-testing touch-deploy-testing
loglink:
- mkdir ~/Library/Logs/foodprint
- touch target/development.log
- touch target/test.log
- touch target/grails.log
- touch target/root.log
- touch target/stacktrace.log
- ln target/development.log ~/Library/Logs/foodprint/development.log
- ln target/grails.log ~/Library/Logs/foodprint/grails.log
- ln target/root.log ~/Library/Logs/foodprint/root.log
- ln target/stacktrace.log ~/Library/Logs/foodprint/stacktrace.log
- ln target/test.log ~/Library/Logs/foodprint/test.log