forked from twers/re-education
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
50 lines (41 loc) · 786 Bytes
/
build.sh
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
function install_bundle {
bundle install --system --without production
}
function build_local {
install_bundle && \
migrate && \
RAILS_ENV=test rake test && \
RAILS_ENV=test bundle exec rspec
}
function ut {
migrate && \
RAILS_ENV=test rake test && \
RAILS_ENV=test bundle exec rspec
}
function migrate {
RAILS_ENV=test rake db:drop db:create db:migrate db:seed
}
function server {
RAILS_ENV=test rake db:drop db:create db:migrate db:seed && \
RAILS_ENV=test rails s
}
function usage {
printf "
options:
h: Display this
m: Migrate Database
ut: Run Unit Test only
s: Start Server
*: Run local build script
"
}
function main {
case $1 in
h) usage ;;
ut) ut ;;
m) migrate ;;
s) server ;;
*) build_local ;;
esac
}
main $@