ors 0.2.2 → 0.2.3

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.
@@ -9,10 +9,15 @@ module ORS::Commands
9
9
  environments = [environment]
10
10
  end
11
11
 
12
- environments.each do |e|
13
- unless ORS::Config.git.branches[e].nil?
14
- info "Syncing environment/branch #{e}..."
15
- system "git co master && git co #{e} && git pull && git merge master && git push && git co master"
12
+ environments.each do |environment|
13
+ unless ORS::Config.git.branches[environment].nil?
14
+ info "Syncing environment/branch #{environment}..."
15
+ execute_command :localhost, %(git checkout master),
16
+ %(git checkout #{environment}),
17
+ %(git pull),
18
+ %(git rebase master),
19
+ %(git push),
20
+ %(git checkout master)
16
21
  end
17
22
  end
18
23
  end
data/lib/ors/helpers.rb CHANGED
@@ -83,6 +83,7 @@ module ORS
83
83
  def execute_command server, *command_array
84
84
  options = {:exec => false, :capture => false}
85
85
  options.merge!(command_array.pop) if command_array.last.is_a?(Hash)
86
+ options[:local] = true if server.to_s == "localhost"
86
87
 
87
88
  command = build_command(server, command_array, options)
88
89
 
@@ -118,10 +119,14 @@ module ORS
118
119
  commands = command_array.join " && "
119
120
  psuedo_tty = options[:exec] ? '-t ' : ''
120
121
 
121
- if use_gateway
122
- %(ssh #{psuedo_tty}#{gateway} 'ssh #{psuedo_tty}#{deploy_user}@#{server} "#{commands}"')
122
+ if options[:local]
123
+ commands
123
124
  else
124
- %(ssh #{psuedo_tty}#{deploy_user}@#{server} "#{commands}")
125
+ if use_gateway
126
+ %(ssh #{psuedo_tty}#{gateway} 'ssh #{psuedo_tty}#{deploy_user}@#{server} "#{commands}"')
127
+ else
128
+ %(ssh #{psuedo_tty}#{deploy_user}@#{server} "#{commands}")
129
+ end
125
130
  end
126
131
  end
127
132
 
data/lib/ors/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ORS
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ors
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jason Dew and John Long
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-19 00:00:00 -04:00
18
+ date: 2011-04-25 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency