Module: Marionetta

Defined in:
lib/marionetta.rb,
lib/marionetta/group.rb,
lib/marionetta/commandable.rb,
lib/marionetta/rake_helper.rb,
lib/marionetta/manipulators.rb,
lib/marionetta/command_runner.rb,
lib/marionetta/directory_sync.rb,
lib/marionetta/manipulators/puppet.rb,
lib/marionetta/manipulators/debloyer.rb,
lib/marionetta/manipulators/deployer.rb

Overview

`Manipulators` is a container for registering manipulators.

The interface of a manipulator is:

self.tasks()        an array of methods to expose via
                    RakeHelpers *optional*

initialize(server)  *required*
can?()              *required*

Defined Under Namespace

Modules: Commandable, Manipulators, RakeHelper Classes: CommandRunner, DirectorySync, Group

Constant Summary collapse

VERSION =
'0.4.11'

Class Method Summary collapse

Class Method Details

.default_serverObject

In order to connect to servers you must define configs for each. This method provides a default hash describing some common settings including command binaries, default flags and more.

One interesting this to note is a logger is set, pointing to `STDOUT`.

Do not get too caught up in this method, it is called elsewhere in Marionetta where you can better define your servers. You should consult this method in order to see the defaults.

Any place in this library you see a variable called `server` you can be certain it is a server hash.


50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/marionetta.rb', line 50

def self.default_server()
  {
    :logger => Logger.new($stdout),

    :ssh => {
      :command => 'ssh',
      :flags   => [],
    },

    :rsync => {
      :command => 'rsync',
      :flags   => ['-azhP', '--delete'],
    },

    :archive => {
      :command => 'tar',
      :flags => ['-zvc'],
      :ext => 'tar.gz',
    },

    :extract => {
      :command => 'tar',
      :flags => ['-xv'],
    },

    :puppet => {},

    :deployer => {
      :tmp => '/tmp',
      :version => {
        :command => "git log --pretty=format:'%h' -n 1", 
      }
    },

    :debloyer => {
      :name => 'debloyer',
      :fpm => {
        :command => 'fpm',
        :flags => [
          '-s', 'dir',
          '-t', 'deb',
        ],
      },
    },
  }
end