puppi 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +0 -4
- data/README.rdoc +20 -8
- data/lib/puppi.rb +15 -18
- data/lib/puppi/files.rb +7 -0
- data/lib/puppi/notification.rb +6 -6
- data/lib/puppi/notifications.rb +6 -0
- data/lib/puppi/version.rb +1 -1
- metadata +99 -97
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
= Puppi on Ruby
|
1
|
+
= Puppi on Ruby - Experimental version of Puppi in Ruby
|
2
2
|
|
3
|
-
|
4
|
-
It's supposed to replace the existing puppi command written in bash.
|
3
|
+
{<img src="https://secure.travis-ci.org/zertico/puppi.png" />}[http://travis-ci.org/zertico/puppi] {<img src="https://codeclimate.com/badge.png" />}[https://codeclimate.com/github/zertico/puppi]
|
5
4
|
|
5
|
+
It's supposed to replace the existing puppi command written in bash.
|
6
6
|
|
7
7
|
== README (DRIVEN DEVELOPMENT)
|
8
8
|
|
@@ -14,11 +14,11 @@ The puppi command has these possibile actions:
|
|
14
14
|
|
15
15
|
* [ puppi deploy project_name ] : Deploys the defined project
|
16
16
|
|
17
|
-
* [ puppi rollback project_name ] : Rollback to a previous deploy state
|
17
|
+
* [ puppi rollback project_name ] : Rollback to a previous deploy state
|
18
18
|
|
19
|
-
* [ puppi check ] : Runs project specific and host wide checks
|
19
|
+
* [ puppi check ] : Runs project specific and host wide checks
|
20
20
|
|
21
|
-
* [ puppi log ] : Tails system wide or project specific logs
|
21
|
+
* [ puppi log ] : Tails system wide or project specific logs
|
22
22
|
|
23
23
|
* [ puppi info topic_name ] : Show system information (for all or only the specified topic)
|
24
24
|
|
@@ -45,7 +45,19 @@ And these options:
|
|
45
45
|
|
46
46
|
=== Files and directories
|
47
47
|
|
48
|
-
* /etc/puppi/data (datadir) contains one yaml file for each Puppet class or defines that uses the puppi::ze define.
|
48
|
+
* /etc/puppi/data (datadir) contains one yaml file for each Puppet class or defines that uses the puppi::ze define.
|
49
49
|
This yaml contains all the variables provided by the class / define and has this naming layout:
|
50
50
|
helper_module.yaml. Where helper is the name of the helper file to use to manage the variables provided in the file and module is the name of the module or class or define that has created the yaml via puppi::ze
|
51
|
-
* /etc/puppi/helpers contains the helpers file (created by puppi::helper): a Yaml that describes, for each puppi action, what commands to run and the names of the variables to use (as named in the /etc/puppi/data/helper_module.yaml files)
|
51
|
+
* /etc/puppi/helpers contains the helpers file (created by puppi::helper): a Yaml that describes, for each puppi action, what commands to run and the names of the variables to use (as named in the /etc/puppi/data/helper_module.yaml files)
|
52
|
+
|
53
|
+
== Mantainers
|
54
|
+
|
55
|
+
{@fernandes}[https://github.com/fernandes]
|
56
|
+
|
57
|
+
== Contributing
|
58
|
+
|
59
|
+
1. Fork it
|
60
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
61
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
62
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
63
|
+
5. Create new Pull Request
|
data/lib/puppi.rb
CHANGED
@@ -1,18 +1,15 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
require 'yaml'
|
3
|
+
|
1
4
|
module Puppi
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
require 'puppi/notifications/mail'
|
11
|
-
require 'puppi/notifications/stdout'
|
12
|
-
require 'puppi/version'
|
13
|
-
require 'yaml'
|
14
|
-
require 'pry'
|
15
|
-
|
5
|
+
autoload :Files, 'puppi/files'
|
6
|
+
autoload :Action, 'puppi/action'
|
7
|
+
autoload :GenerateSampleData, 'puppi/generate_sample_data'
|
8
|
+
autoload :Loader, 'puppi/loader'
|
9
|
+
autoload :Notification, 'puppi/notification'
|
10
|
+
autoload :Notifications, 'puppi/notifications'
|
11
|
+
autoload :Version, 'puppi/version'
|
12
|
+
|
16
13
|
if ENV["RUN_ENV"] == "TEST"
|
17
14
|
@@puppidir = File.dirname(File.dirname(__FILE__))+"/tmp/config"
|
18
15
|
@@stdout_print = false
|
@@ -20,16 +17,16 @@ module Puppi
|
|
20
17
|
@@puppidir = "/etc/puppi"
|
21
18
|
@@stdout_print = true
|
22
19
|
end
|
23
|
-
|
20
|
+
|
24
21
|
class << self
|
25
22
|
def puppidir
|
26
23
|
@@puppidir
|
27
24
|
end
|
28
|
-
|
25
|
+
|
29
26
|
def stdout_print
|
30
27
|
@@stdout_print
|
31
28
|
end
|
32
|
-
|
29
|
+
|
33
30
|
def initial_checks
|
34
31
|
directories = %w[ data helpers notifications ]
|
35
32
|
directories.each do |directory|
|
@@ -38,4 +35,4 @@ module Puppi
|
|
38
35
|
end
|
39
36
|
end
|
40
37
|
end
|
41
|
-
end
|
38
|
+
end
|
data/lib/puppi/files.rb
ADDED
data/lib/puppi/notification.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
module Puppi
|
2
2
|
class Notification
|
3
|
-
|
3
|
+
|
4
4
|
attr_reader :notify_methods
|
5
|
-
|
5
|
+
|
6
6
|
def initialize(notifications, output)
|
7
7
|
@notify_methods = Array.new
|
8
|
-
|
8
|
+
|
9
9
|
if notifications.empty?
|
10
10
|
notifier = Puppi::Notifications::Stdout.new
|
11
11
|
notifier.output(output)
|
@@ -22,7 +22,7 @@ module Puppi
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
def validate_notifications_methods (notifications)
|
27
27
|
notifications.each do |notification|
|
28
28
|
if !valid_method? notification
|
@@ -30,7 +30,7 @@ module Puppi
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
33
|
-
|
33
|
+
|
34
34
|
private
|
35
35
|
def valid_method? (method)
|
36
36
|
@valid_methods = Array.new
|
@@ -40,4 +40,4 @@ module Puppi
|
|
40
40
|
@valid_methods.include? method.capitalize
|
41
41
|
end
|
42
42
|
end
|
43
|
-
end
|
43
|
+
end
|
data/lib/puppi/version.rb
CHANGED
metadata
CHANGED
@@ -1,105 +1,108 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppi
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 0.0.2
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Celso Fernandes
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
22
|
-
none: false
|
23
|
-
requirements:
|
24
|
-
- - ">="
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
hash: 3
|
27
|
-
segments:
|
28
|
-
- 0
|
29
|
-
version: "0"
|
30
|
-
prerelease: false
|
31
|
-
type: :development
|
12
|
+
date: 2012-10-26 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
32
15
|
name: autotest
|
33
|
-
requirement:
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
version_requirements: &id002 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
36
17
|
none: false
|
37
|
-
requirements:
|
38
|
-
- -
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
|
41
|
-
segments:
|
42
|
-
- 0
|
43
|
-
version: "0"
|
44
|
-
prerelease: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
45
22
|
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
46
31
|
name: rspec
|
47
|
-
requirement:
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
50
33
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
55
|
-
segments:
|
56
|
-
- 0
|
57
|
-
version: "0"
|
58
|
-
prerelease: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
59
38
|
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
60
47
|
name: fakefs
|
61
|
-
requirement:
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
64
49
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
|
69
|
-
segments:
|
70
|
-
- 0
|
71
|
-
version: "0"
|
72
|
-
prerelease: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
73
54
|
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
74
63
|
name: simplecov
|
75
|
-
requirement:
|
76
|
-
- !ruby/object:Gem::Dependency
|
77
|
-
version_requirements: &id005 !ruby/object:Gem::Requirement
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
78
65
|
none: false
|
79
|
-
requirements:
|
80
|
-
- -
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
|
83
|
-
|
84
|
-
- 0
|
85
|
-
version: "0"
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
86
71
|
prerelease: false
|
87
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
88
79
|
name: mail
|
89
|
-
requirement:
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
description: ! "Puppi is a Puppet module that lets sysadmins standardize, manage and
|
95
|
+
automate the deployment of web applications \nand provides quick and standard commands
|
96
|
+
to obtain informations about the system and what’s is going on it.\n\nIts structure
|
97
|
+
provides FULL flexibility on the actions required for virtually any kind of application
|
98
|
+
deployment \nand information gathering.\n"
|
99
|
+
email:
|
95
100
|
- fernandes@zertico.com
|
96
|
-
executables:
|
101
|
+
executables:
|
97
102
|
- puppi
|
98
103
|
extensions: []
|
99
|
-
|
100
104
|
extra_rdoc_files: []
|
101
|
-
|
102
|
-
files:
|
105
|
+
files:
|
103
106
|
- .autotest
|
104
107
|
- .gitignore
|
105
108
|
- .rvmrc
|
@@ -111,12 +114,14 @@ files:
|
|
111
114
|
- bin/puppi
|
112
115
|
- lib/puppi.rb
|
113
116
|
- lib/puppi/action.rb
|
117
|
+
- lib/puppi/files.rb
|
114
118
|
- lib/puppi/files/datafile.rb
|
115
119
|
- lib/puppi/files/helper.rb
|
116
120
|
- lib/puppi/files/notification.rb
|
117
121
|
- lib/puppi/generate_sample_data.rb
|
118
122
|
- lib/puppi/loader.rb
|
119
123
|
- lib/puppi/notification.rb
|
124
|
+
- lib/puppi/notifications.rb
|
120
125
|
- lib/puppi/notifications/mail.rb
|
121
126
|
- lib/puppi/notifications/stdout.rb
|
122
127
|
- lib/puppi/version.rb
|
@@ -135,38 +140,35 @@ files:
|
|
135
140
|
- spec/support/publicize_methods.rb
|
136
141
|
homepage: http://fernandes.github.com/puppi
|
137
142
|
licenses: []
|
138
|
-
|
139
143
|
post_install_message:
|
140
144
|
rdoc_options: []
|
141
|
-
|
142
|
-
require_paths:
|
145
|
+
require_paths:
|
143
146
|
- lib
|
144
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
147
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
145
148
|
none: false
|
146
|
-
requirements:
|
147
|
-
- -
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
|
150
|
-
segments:
|
149
|
+
requirements:
|
150
|
+
- - ! '>='
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
segments:
|
151
154
|
- 0
|
152
|
-
|
153
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
|
+
hash: -3164689875632596067
|
156
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
157
|
none: false
|
155
|
-
requirements:
|
156
|
-
- -
|
157
|
-
- !ruby/object:Gem::Version
|
158
|
-
|
159
|
-
segments:
|
158
|
+
requirements:
|
159
|
+
- - ! '>='
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
version: '0'
|
162
|
+
segments:
|
160
163
|
- 0
|
161
|
-
|
164
|
+
hash: -3164689875632596067
|
162
165
|
requirements: []
|
163
|
-
|
164
166
|
rubyforge_project: puppi
|
165
167
|
rubygems_version: 1.8.24
|
166
168
|
signing_key:
|
167
169
|
specification_version: 3
|
168
170
|
summary: Puppet module to manage applications deployments and servers local management
|
169
|
-
test_files:
|
171
|
+
test_files:
|
170
172
|
- spec/core/rake_task.rb
|
171
173
|
- spec/puppi/action_spec.rb
|
172
174
|
- spec/puppi/files/datafile_spec.rb
|