bricks-deploy 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09d4a4cbcab76b8e5917aeffb058da208cc2ffac
|
4
|
+
data.tar.gz: 10d7779d76f93758dfed2ea1675de2973975b910
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9e4f43e6c44c5590286ae61bbe3457ae105c5a3f696f99ffdb8c9c556f5519e6e40a394cc000f99dd53b68c4de07f4096df2d3d9fe39a81406630adaefca9db
|
7
|
+
data.tar.gz: 40d08c1f51b28801f226d0e4cbe8d1d547986ca280bf7db58f755111e930e8651606d3fdd4d9508364f684f406afa25a0da5a59a3db58712412600ce64f7af5f
|
@@ -8,15 +8,15 @@ class BricksDeploy::Generator < Thor::Group
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def copy_main_hook
|
11
|
-
copy_hook 'after_push.sh', 'deploy/after_push'
|
11
|
+
copy_hook 'after_push.sh', 'bin/deploy/remote/after_push'
|
12
12
|
end
|
13
13
|
|
14
14
|
def copy_restart_hook
|
15
|
-
copy_hook 'restart.sh', 'deploy/restart'
|
15
|
+
copy_hook 'restart.sh', 'bin/deploy/remote/restart'
|
16
16
|
end
|
17
17
|
|
18
18
|
def copy_restart_callbacks
|
19
|
-
copy_hook 'before_restart.rb', 'deploy/before_restart'
|
19
|
+
copy_hook 'before_restart.rb', 'bin/deploy/remote/before_restart'
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
@@ -13,5 +13,5 @@ umask 002
|
|
13
13
|
|
14
14
|
git submodule sync && git submodule update --init --recursive
|
15
15
|
|
16
|
-
run deploy/before_restart
|
17
|
-
run deploy/restart && run deploy/after_restart
|
16
|
+
run bin/deploy/remote/before_restart
|
17
|
+
run bin/deploy/remote/restart && run bin/deploy/remote/after_restart
|
data/lib/bricks_deploy.rb
CHANGED
@@ -42,8 +42,8 @@ class BricksDeploy < Thor
|
|
42
42
|
cmd << "git config --bool receive.denyNonFastForwards false" if options.shared?
|
43
43
|
cmd << "git config receive.denyCurrentBranch ignore"
|
44
44
|
cmd << "mkdir deploy"
|
45
|
-
cmd << "echo #{options.stage} >
|
46
|
-
cmd << "echo #{options.color} >
|
45
|
+
cmd << "echo #{options.stage} > app/config/stage"
|
46
|
+
cmd << "echo #{options.color} > app/config/color"
|
47
47
|
end
|
48
48
|
|
49
49
|
invoke :hooks
|
@@ -60,7 +60,7 @@ class BricksDeploy < Thor
|
|
60
60
|
|
61
61
|
desc "restart", "Restarts the application on the server"
|
62
62
|
def restart
|
63
|
-
run "cd #{deploy_to} && deploy/restart 2>&1 | tee -a
|
63
|
+
run "cd #{deploy_to} && bin/deploy/remote/restart 2>&1 | tee -a var/logs/deploy.log"
|
64
64
|
end
|
65
65
|
|
66
66
|
desc "rerun", "Runs the `deploy/after_push' callback as if a new revision was pushed via git"
|
@@ -69,7 +69,7 @@ class BricksDeploy < Thor
|
|
69
69
|
bash -e -c '
|
70
70
|
cd '#{deploy_to}'
|
71
71
|
declare -a revs=( $(git rev-parse HEAD@{1} HEAD) )
|
72
|
-
deploy/after_push ${revs[@]} 2>&1 | tee -a
|
72
|
+
bin/deploy/remote/after_push ${revs[@]} 2>&1 | tee -a var/logs/deploy.log
|
73
73
|
'
|
74
74
|
BASH
|
75
75
|
end
|
@@ -82,8 +82,8 @@ class BricksDeploy < Thor
|
|
82
82
|
declare -a revs=( $(git rev-parse HEAD HEAD@{1}) )
|
83
83
|
git reset --hard ${revs[1]}
|
84
84
|
callback=after_push
|
85
|
-
[ -x deploy/rollback ] && callback=rollback
|
86
|
-
deploy/$callback ${revs[@]} 2>&1 | tee -a
|
85
|
+
[ -x bin/deploy/remote/rollback ] && callback=rollback
|
86
|
+
bin/deploy/remote/$callback ${revs[@]} 2>&1 | tee -a var/logs/deploy.log
|
87
87
|
'
|
88
88
|
BASH
|
89
89
|
end
|
@@ -93,7 +93,7 @@ class BricksDeploy < Thor
|
|
93
93
|
method_option :lines, :aliases => '-l', :type => :numeric, :default => 20
|
94
94
|
def log(n = nil)
|
95
95
|
tail_args = options.tail? ? '-f' : "-n#{n || options.lines}"
|
96
|
-
run "tail #{tail_args} #{deploy_to}/
|
96
|
+
run "tail #{tail_args} #{deploy_to}/var/logs/deploy.log"
|
97
97
|
end
|
98
98
|
|
99
99
|
desc "upload <files>", "Copy local files to the remote app"
|
data/lib/hooks/post-receive.sh
CHANGED
@@ -31,13 +31,13 @@ fi
|
|
31
31
|
umask 002
|
32
32
|
git reset --hard
|
33
33
|
|
34
|
-
logfile=
|
35
|
-
restart=tmp/restart.txt
|
34
|
+
logfile=var/logs/deploy.log
|
35
|
+
restart=var/tmp/restart.txt
|
36
36
|
|
37
37
|
if [ -z "${oldrev//0}" ]; then
|
38
38
|
# this is the first push; this branch was just created
|
39
|
-
mkdir -p
|
40
|
-
chmod 0775
|
39
|
+
mkdir -p var/logs var/tmp
|
40
|
+
chmod 0775 var/logs var/tmp
|
41
41
|
touch $logfile $restart
|
42
42
|
chmod 0664 $logfile $restart
|
43
43
|
|
@@ -45,11 +45,11 @@ if [ -z "${oldrev//0}" ]; then
|
|
45
45
|
git submodule update --recursive --init 2>&1 | tee -a $logfile
|
46
46
|
|
47
47
|
# execute the one-time setup hook
|
48
|
-
[ -x deploy/setup ] && deploy/setup $oldrev $newrev 2>&1 | tee -a $logfile
|
48
|
+
[ -x bin/deploy/remote/setup ] && bin/deploy/remote/setup $oldrev $newrev 2>&1 | tee -a $logfile
|
49
49
|
else
|
50
50
|
# log timestamp
|
51
51
|
echo ==== $(date) ==== >> $logfile
|
52
52
|
|
53
53
|
# execute the main deploy hook
|
54
|
-
[ -x deploy/after_push ] && deploy/after_push $oldrev $newrev 2>&1 | tee -a $logfile
|
54
|
+
[ -x bin/deploy/remote/after_push ] && bin/deploy/remote/after_push $oldrev $newrev 2>&1 | tee -a $logfile
|
55
55
|
fi
|