forked from ucberkeley/Beehive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
capit.bat
67 lines (54 loc) · 1.25 KB
/
capit.bat
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
@echo off
if not "%nocls%"=="1" cls
setlocal
set nocls=1
set task=%1
if "%task%"=="" goto :help
goto :%task%
if not %errorlevel%==0 goto :help
goto :end
:notify
msg %username% "hi"
goto :next
:deploy
echo Deploying...
call cap deploy
goto :next
:update
echo Updating...
call cap deploy:update
goto :next
:start_solr
echo Starting solr...
call cap invoke COMMAND="cd /mnt/app/current;rake solr:stop RAILS_ENV=production;nohup rake solr:start RAILS_ENV=production > /dev/null 2>&1 &"
goto :next
:migrate
echo Migrating...
call cap deploy:migrate
goto :next
:reindex
echo Reindexing solr (remember, it needs to be started first!)...
call cap invoke COMMAND="cd /mnt/app/current;rake solr:reindex RAILS_ENV=production"
goto :next
:do_everything
%0 update then migrate then start_solr then deploy
goto :end
:then
goto :next
:next
%0 %2 %3 %4 %5 %6 %7 %8 %9 end
goto :end
:help
echo %~n0
echo.
echo Runs multiple cap commands in a row.
echo Syntax: %~n0 [command1 [THEN command2 [THEN command3 ... ] ] ]
echo.
echo Supported commands: deploy, update, start_solr, migrate, do_everything, notify
echo do_everything = update then migrate then start_solr then deploy
echo notify gives you a nice notify. Use it like '%~n0 update then notify'
echo.
goto :end
:end
echo.
endlocal