sunrise-deploy 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,6 +11,11 @@ module Capistrano
|
|
11
11
|
end
|
12
12
|
|
13
13
|
set :strategy, Sunrise::Deploy::Strategy::Simple.new(self)
|
14
|
+
set :rake, "bundle exec rake"
|
15
|
+
|
16
|
+
# Must be set for the password prompt from git to work
|
17
|
+
set :ssh_options, { :forward_agent => true }
|
18
|
+
set :default_run_options, { :pty => true}
|
14
19
|
|
15
20
|
_cset :rails_env, "production"
|
16
21
|
_cset :rvm_ruby_string, '1.9.3'
|
@@ -20,12 +25,6 @@ module Capistrano
|
|
20
25
|
_cset :scm_verbose, true
|
21
26
|
_cset :branch, "master"
|
22
27
|
|
23
|
-
# Must be set for the password prompt from git to work
|
24
|
-
_cset :ssh_options, { :forward_agent => true }
|
25
|
-
_cset :default_run_options, { :pty => true}
|
26
|
-
|
27
|
-
_cset :rake, "bundle exec rake"
|
28
|
-
|
29
28
|
_cset :asset_precompile, true
|
30
29
|
_cset :asset_env, "RAILS_GROUPS=assets"
|
31
30
|
_cset :assets_prefix, "assets"
|
@@ -12,7 +12,29 @@ module Sunrise
|
|
12
12
|
protected
|
13
13
|
|
14
14
|
def command
|
15
|
-
|
15
|
+
#@command ||= source.sync(revision, deploy_to)
|
16
|
+
|
17
|
+
git = source.command
|
18
|
+
remote = source.origin
|
19
|
+
|
20
|
+
execute = []
|
21
|
+
execute << "cd #{configuration[:deploy_to]}"
|
22
|
+
|
23
|
+
if remote != 'origin'
|
24
|
+
execute << "#{git} config remote.#{remote}.url #{configuration[:repository]}"
|
25
|
+
execute << "#{git} config remote.#{remote}.fetch +refs/heads/*:refs/remotes/#{remote}/*"
|
26
|
+
end
|
27
|
+
|
28
|
+
execute << "#{git} checkout #{configuration[:branch]}"
|
29
|
+
execute << "#{git} pull #{remote} #{configuration[:branch]}"
|
30
|
+
|
31
|
+
execute.join(" && ")
|
32
|
+
end
|
33
|
+
|
34
|
+
# Returns the command which will write the identifier of the
|
35
|
+
# revision being deployed to the REVISION file on each host.
|
36
|
+
def mark
|
37
|
+
"(echo #{Time.now} > #{configuration[:deploy_to]}/REVISION)"
|
16
38
|
end
|
17
39
|
end
|
18
40
|
end
|