ors 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ors/commands/sync.rb +22 -0
- data/lib/ors/config.rb +2 -0
- data/lib/ors/version.rb +1 -1
- metadata +5 -4
@@ -0,0 +1,22 @@
|
|
1
|
+
module ORS::Commands
|
2
|
+
|
3
|
+
class Sync < Base
|
4
|
+
|
5
|
+
def execute
|
6
|
+
if options.first == '--all'
|
7
|
+
environments = ORS::Config.valid_environments
|
8
|
+
else
|
9
|
+
environments = [environment]
|
10
|
+
end
|
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"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
data/lib/ors/config.rb
CHANGED
@@ -5,6 +5,7 @@ module ORS
|
|
5
5
|
|
6
6
|
mattr_accessor :name, :environment, :use_gateway, :pretending, :log_lines, :rails2, :deploy_hook
|
7
7
|
mattr_accessor :gateway, :deploy_user, :repo, :base_path, :web_servers, :app_servers, :migration_server, :console_server, :cron_server
|
8
|
+
mattr_accessor :options
|
8
9
|
|
9
10
|
self.environment = "production"
|
10
11
|
self.pretending = false
|
@@ -16,6 +17,7 @@ module ORS
|
|
16
17
|
def parse_options options
|
17
18
|
self.name = name_from_git
|
18
19
|
self.environment = options.shift unless options.empty? or options.first.match(/^-/)
|
20
|
+
self.options = options.dup
|
19
21
|
|
20
22
|
options.each do |option|
|
21
23
|
case option
|
data/lib/ors/version.rb
CHANGED
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:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
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-
|
18
|
+
date: 2011-04-19 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -93,6 +93,7 @@ files:
|
|
93
93
|
- lib/ors/commands/setup.rb
|
94
94
|
- lib/ors/commands/start.rb
|
95
95
|
- lib/ors/commands/stop.rb
|
96
|
+
- lib/ors/commands/sync.rb
|
96
97
|
- lib/ors/commands/update.rb
|
97
98
|
- lib/ors/config.rb
|
98
99
|
- lib/ors/core_ext.rb
|