-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun.sh
executable file
·42 lines (33 loc) · 970 Bytes
/
run.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
#!/bin/sh
if ! type gem &> /dev/null ; then
fail "ruby gem not found."
fi
debug "ruby version: $(ruby --version)"
debug "gem version: $(gem --version)"
# Capistrano
debug "installing capistrano"
sudo gem install capistrano
debug "capistrano version: $(cap --version)"
# Capistrano composer
debug "installing capistrano-composer"
sudo gem install capistrano-composer
capistrano_command="cap"
# Parse some variable arguments
if [ -n "$WERCKER_CAPISTRANO_STAGE" ] ; then
capistrano_command="$capistrano_command $WERCKER_CAPISTRANO_STAGE"
else
capistrano_command="$capistrano_command production"
fi
if [ -n "$WERCKER_CAPISTRANO_TASKS" ] ; then
capistrano_command="$capistrano_command $WERCKER_CAPISTRANO_TASKS"
else
capistrano_command="$capistrano_command deploy"
fi
debug "$capistrano_command"
$capistrano_command
if [[ $? -ne 0 ]]; then
warn "$result"
fail "capistrano command failed"
else
success "finished $capistrano_command"
fi