orca 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- orca (0.3.3)
4
+ orca (0.3.4)
5
5
  colored
6
6
  net-sftp
7
7
  net-ssh
data/README.md CHANGED
@@ -70,7 +70,7 @@ This will create a config/orca.rb file for you to get started with.
70
70
 
71
71
  To ship run a command the syntax is as follows...
72
72
 
73
- orca [command] [package] [node]
73
+ orca [command] [package] [group_or_node]
74
74
 
75
75
  So here are some examples (assuming you have a package called "app" and a node called "server" defined in your orca.rb)...
76
76
 
@@ -78,7 +78,7 @@ So here are some examples (assuming you have a package called "app" and a node c
78
78
  orca remove app server
79
79
  orca validate app server
80
80
 
81
- If you have a package with the same name as a group or server you can abreviate this to...
81
+ If you have a package with the same name as a group or node you can abreviate this to...
82
82
 
83
83
  orca apply server
84
84
  orca remove server
@@ -101,13 +101,18 @@ Options, all commands support the following optional parameters...
101
101
  The Orca DSL
102
102
  ------------
103
103
 
104
- Orca packages are written in a Ruby based DSL. It's really simple to learn in less than 5 mins. Here's an example orca.rb file with all you'll need to know to get started...
104
+ Orca packages are written in a Ruby based DSL. It's really simple to learn in less than 5 mins. Below is an example orca.rb file with some hints to help you get started. A more complete WIP example can be found in this gist... https://gist.github.com/andykent/5814997
105
+
106
+ group 'web' do # groups are collections of nodes that can be referenced by name
107
+ node 'web-1.mysite.com' # nodes are usually machines or VMs that you intend to configure
108
+ includes 'uploaders' # groups are composable so a group can contain nodes from another group
109
+ end # orca will execute tasks concurrently across all nodes in a group
105
110
 
106
111
  # define a new pacage called 'gem' that provides some actions for managing rubygems
107
112
  package 'gem' do
108
- depends_on 'ruby-1.9.3' # this package depends on another package called ruby-1.9.3
109
- action 'exists' do |gem_name| # define an action that other packages can trigger called 'exists'
110
- run("gem list -i #{gem_name}") =~ /true/ # execute the command, get the output and check it contains 'true'
113
+ depends_on 'ruby-1.9.3' # this package depends on another package called ruby-1.9.3
114
+ action 'exists' do |gem_name| # define an action that other packages can trigger called 'exists'
115
+ run("gem list -i #{gem_name}") =~ /true/ # execute the command, get the output and check it contains 'true'
111
116
  end
112
117
  action 'install' do |gem_name|
113
118
  run "gem install #{gem_name} --no-ri --no-rdoc"
@@ -121,17 +126,16 @@ Orca packages are written in a Ruby based DSL. It's really simple to learn in le
121
126
  package 'bundler' do
122
127
  depends_on 'gem'
123
128
  apply do # apply gets called whenever this package or a package that depends on it is applied
124
- trigger('gem:install', 'bundler') # trigger triggers defined actions, in this case the action 'instal' on 'gem'
129
+ trigger('gem:install', 'bundler') # trigger triggers defined actions, in this case the action 'install' on 'gem'
125
130
  end
126
131
  remove do # remove gets called whenever this package or a package that depends on it is removed
127
- trigger('gem:remove', 'bundler')
132
+ trigger('gem:uninstall', 'bundler')
128
133
  end
129
134
  validate do # validate is used internally to check if the package is applied correctly or not
130
- trigger('gem:exists', 'bundler')
135
+ trigger('gem:exists', 'bundler') # validate should return true if the package is applied correctly
131
136
  end
132
137
  end
133
138
 
134
- A more complete WIP example can be found in this gist... https://gist.github.com/andykent/5814997
135
139
 
136
140
 
137
141
  Extensions
@@ -145,6 +149,7 @@ Some example extensions are included in this repo and can be required into your
145
149
 
146
150
  `relative "orca/extensions/file_sync"` - Adds support for syncing and converging local/remove files with the `file` action.
147
151
 
152
+ *Note: these extensions are likely to be removed to their own 'contrib' project at some point in the future*
148
153
 
149
154
  Extras
150
155
  ------
@@ -47,10 +47,14 @@ class Orca::Cli < Thor
47
47
  if options[:throw]
48
48
  raise e
49
49
  else
50
- puts "!!! ERROR !!! [#{e.class.name}] #{e.message}".red.bold
50
+ $stderr.puts "!!! ERROR !!! [#{e.class.name}] #{e.message}".red.bold
51
+ exit(1)
51
52
  end
52
53
  ensure
54
+ $stdout.print "Disconnecting...".green
53
55
  suite.cleanup
56
+ $stdout.puts "Done!".green
57
+ exit(0)
54
58
  end
55
59
  end
56
60
 
@@ -15,8 +15,10 @@ class Orca::Runner
15
15
  end
16
16
 
17
17
  def execute(command_name)
18
- @log.say packages.map(&:name).join(', ').yellow
19
- packages.each do |pkg|
18
+ pkgs = packages
19
+ pkgs.reverse! if command_name.to_sym == :remove
20
+ @log.say pkgs.map(&:name).join(', ').yellow
21
+ pkgs.each do |pkg|
20
22
  send(:"execute_#{command_name}", pkg)
21
23
  end
22
24
  end
@@ -10,7 +10,7 @@ Gem::Specification.new do |gem|
10
10
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
11
11
  gem.name = "orca"
12
12
  gem.require_paths = ["lib"]
13
- gem.version = '0.3.3'
13
+ gem.version = '0.3.4'
14
14
  gem.add_dependency('colored')
15
15
  gem.add_dependency('net-ssh')
16
16
  gem.add_dependency('net-sftp')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orca
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-28 00:00:00.000000000 Z
12
+ date: 2013-06-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: colored
@@ -133,7 +133,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  segments:
135
135
  - 0
136
- hash: -3898811184980038862
136
+ hash: 565408569363101895
137
137
  required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements:
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  version: '0'
143
143
  segments:
144
144
  - 0
145
- hash: -3898811184980038862
145
+ hash: 565408569363101895
146
146
  requirements: []
147
147
  rubyforge_project:
148
148
  rubygems_version: 1.8.23