sunrise-deploy 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- @command ||= source.sync(revision, deploy_to)
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
@@ -1,5 +1,5 @@
1
1
  module Sunrise
2
2
  module Deploy
3
- VERSION = "0.0.1".freeze
3
+ VERSION = "0.0.2".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunrise-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: