marionetta 0.3.6 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Marionetta
2
2
 
3
- Marionetta is a ruby library for executing commands to one
3
+ Marionetta is a ruby library for executing commands on one
4
4
  or more remote machines via SSH.
5
5
 
6
6
  It provides puppet provisioning without the need for a puppet
@@ -18,10 +18,38 @@ gem install marionetta
18
18
  Or – better yet – in your Gemfile:
19
19
 
20
20
  ``` ruby
21
- source "http://rubygems.org"
21
+ source 'http://rubygems.org'
22
22
  gem 'marionetta'
23
23
  ```
24
24
 
25
+ ## Using Marionetta in your Rakefile
26
+
27
+ Marionetta provides an easy mechanism to generate rake tasks
28
+ for each of your groups.
29
+
30
+ In your Rakefile you can do something like so:
31
+
32
+ ``` ruby
33
+ require 'marionetta/group'
34
+ require 'marionetta/rake_helper'
35
+
36
+ staging = Marionetta::Group.new(:staging)
37
+
38
+ staging.add_server do |s|
39
+ s[:hostname] = 'staging.example.com'
40
+ s[:ssh][:flags] << ['-i', 'keys/private.key']
41
+ s[:puppet][:manifest] = 'puppet/manifest.pp'
42
+ s[:deployer][:from] = '/my-app'
43
+ s[:deployer][:to] = '/home/staging/www'
44
+ end
45
+
46
+ Marionetta::RakeHelper.install_group_tasks(staging)
47
+ ```
48
+
49
+ The tasks `puppet:staging:install`, `puppet:staging:update`,
50
+ `deployer:staging:deploy` and `deployer:staging:rollback`
51
+ will now be available in your Rakefile.
52
+
25
53
  ## Defining a group of servers
26
54
 
27
55
  Marionetta allows you to describe and manipulate a number of
@@ -121,35 +149,6 @@ Oh and you can rollback to the last release too!
121
149
  staging.manipulate_each_server(:deployer, :rollback)
122
150
  ```
123
151
 
124
- ## Using Marionetta in your Rakefile
125
-
126
- Marionetta provides an easy mechanism to generate rake tasks
127
- for each of your groups.
128
-
129
- In your Rakefile you can do something like so:
130
-
131
- ``` ruby
132
- require 'marionetta/group'
133
- require 'marionetta/rake_helper'
134
-
135
- staging = Marionetta::Group.new(:staging)
136
-
137
- staging.add_server do |s|
138
- s[:hostname] = 'staging.example.com'
139
- s[:puppet][:manifest] = 'puppet/manifest.pp'
140
- s[:deployer][:from] = '/my-app'
141
- s[:deployer][:to] = '/home/staging/www'
142
- end
143
-
144
- Marionetta::RakeHelper.new(staging).install_group_tasks
145
- ```
146
-
147
- The tasks `puppet:staging:install`, `puppet:staging:update`,
148
- `deployer:staging:deploy` and `deployer:staging:rollback`
149
- will now be available in your Rakefile.
150
-
151
- **Groups must have names if you want to generate rake tasks.**
152
-
153
152
  ## Author
154
153
 
155
154
  Luke Morton a.k.a. DrPheltRight
@@ -3,16 +3,12 @@ require 'marionetta/manipulators'
3
3
  require 'rake'
4
4
 
5
5
  module Marionetta
6
- class RakeHelper
7
- include ::Rake::DSL if defined?(::Rake::DSL)
8
-
9
- attr_reader :group
6
+ module RakeHelper
7
+ extend self
10
8
 
11
- def initialize(group)
12
- @group = group
13
- end
9
+ include ::Rake::DSL if defined?(::Rake::DSL)
14
10
 
15
- def install_group_tasks()
11
+ def install_group_tasks(group)
16
12
  install_group_tasks_for(group)
17
13
 
18
14
  group.groups.each do |g|
data/lib/marionetta.rb CHANGED
@@ -1,4 +1,4 @@
1
- # Marionetta is a ruby library for executing commands to one
1
+ # Marionetta is a ruby library for executing commands on one
2
2
  # or more remote machines via SSH.
3
3
  #
4
4
  # It provides puppet provisioning without the need for a
@@ -13,7 +13,7 @@
13
13
  #
14
14
  # Or – better yet – in your Gemfile:
15
15
  #
16
- # source "http://rubygems.org"
16
+ # source 'http://rubygems.org'
17
17
  # gem 'marionetta'
18
18
  #
19
19
  # Marionetta is written by [Luke Morton][author] and licensed
@@ -25,7 +25,7 @@
25
25
  # [github]: https://github.com/DrPheltRight/marionetta
26
26
  module Marionetta
27
27
 
28
- VERSION = '0.3.6'
28
+ VERSION = '0.4.0'
29
29
 
30
30
  ### Defining Servers
31
31
 
data/marionetta.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.authors = ["Luke Morton"]
8
8
  s.email = ["lukemorton.dev@gmail.com"]
9
9
  s.summary = "Provision using puppet and deploy your servers over SSH."
10
- s.description = "Marionetta is a ruby library for executing commands to one
10
+ s.description = "Marionetta is a ruby library for executing commands on one
11
11
  or more remote machines via SSH. It provides puppet
12
12
  provisioning without the need for a puppet master and can
13
13
  also deploy your application code (with rollbacks) via
@@ -7,7 +7,7 @@ describe Marionetta::RakeHelper do
7
7
  vagrant = Marionetta::Group.new(:vagrant)
8
8
  vagrant.add_server(server)
9
9
 
10
- Marionetta::RakeHelper.new(vagrant).install_group_tasks
10
+ Marionetta::RakeHelper.install_group_tasks(vagrant)
11
11
  Rake::Task.tasks.count.should > 0
12
12
 
13
13
  Rake::Task['puppet:vagrant:update'].invoke
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: marionetta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -123,7 +123,7 @@ dependencies:
123
123
  - - ! '>='
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
- description: ! "Marionetta is a ruby library for executing commands to one\n or
126
+ description: ! "Marionetta is a ruby library for executing commands on one\n or
127
127
  more remote machines via SSH. It provides puppet\n provisioning
128
128
  without the need for a puppet master and can\n also deploy your
129
129
  application code (with rollbacks) via\n rsync. With a RakeHelper