deployml 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +3 -0
- data/.rspec +1 -0
- data/.yardopts +1 -0
- data/ChangeLog.md +22 -0
- data/LICENSE.txt +22 -0
- data/README.md +107 -0
- data/Rakefile +35 -0
- data/bin/deployml +5 -0
- data/deployml.gemspec +10 -0
- data/gemspec.yml +21 -0
- data/lib/deployml/cli.rb +192 -0
- data/lib/deployml/configuration.rb +149 -0
- data/lib/deployml/environment.rb +273 -0
- data/lib/deployml/exceptions/config_not_found.rb +4 -0
- data/lib/deployml/exceptions/invalid_config.rb +4 -0
- data/lib/deployml/exceptions/missing_option.rb +6 -0
- data/lib/deployml/exceptions/unknown_environment.rb +4 -0
- data/lib/deployml/exceptions/unknown_framework.rb +6 -0
- data/lib/deployml/exceptions/unknown_server.rb +6 -0
- data/lib/deployml/frameworks/rails2.rb +9 -0
- data/lib/deployml/frameworks/rails3.rb +20 -0
- data/lib/deployml/frameworks.rb +2 -0
- data/lib/deployml/local_shell.rb +54 -0
- data/lib/deployml/options/mongrel.rb +46 -0
- data/lib/deployml/options/thin.rb +72 -0
- data/lib/deployml/options.rb +1 -0
- data/lib/deployml/project.rb +304 -0
- data/lib/deployml/remote_shell.rb +130 -0
- data/lib/deployml/servers/apache.rb +19 -0
- data/lib/deployml/servers/mongrel.rb +41 -0
- data/lib/deployml/servers/thin.rb +41 -0
- data/lib/deployml/servers.rb +3 -0
- data/lib/deployml/shell.rb +46 -0
- data/lib/deployml/version.rb +4 -0
- data/lib/deployml.rb +2 -0
- data/spec/configuration_spec.rb +73 -0
- data/spec/deployml_spec.rb +11 -0
- data/spec/environment_spec.rb +34 -0
- data/spec/helpers/projects/bad_config/config/deploy.yml +1 -0
- data/spec/helpers/projects/basic/config/deploy.yml +3 -0
- data/spec/helpers/projects/invalid_server/config/deploy.yml +4 -0
- data/spec/helpers/projects/missing_config/.gitkeep +0 -0
- data/spec/helpers/projects/missing_dest/config/deploy.yml +2 -0
- data/spec/helpers/projects/missing_source/config/deploy.yml +2 -0
- data/spec/helpers/projects/rails/config/deploy/production.yml +10 -0
- data/spec/helpers/projects/rails/config/deploy/staging.yml +10 -0
- data/spec/helpers/projects/rails/config/deploy.yml +3 -0
- data/spec/helpers/projects.rb +11 -0
- data/spec/project_spec.rb +66 -0
- data/spec/spec_helper.rb +8 -0
- metadata +207 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
require 'deployml/project'
|
4
|
+
|
5
|
+
describe Environment do
|
6
|
+
let(:name) { :staging }
|
7
|
+
subject do
|
8
|
+
Environment.new(name, {
|
9
|
+
'source' => 'git@github.com:user/project.git',
|
10
|
+
'dest' => 'ssh://user@www.example.com/srv/project',
|
11
|
+
'framework' => 'rails3',
|
12
|
+
'orm' => 'datamapper',
|
13
|
+
'server' => {
|
14
|
+
'name' => 'thin',
|
15
|
+
'options' => {
|
16
|
+
'config' => '/etc/thin/project.yml',
|
17
|
+
'socket' => '/tmp/thin.project.sock'
|
18
|
+
}
|
19
|
+
}
|
20
|
+
})
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should default 'environment' to the name of the environment" do
|
24
|
+
subject.environment.should == name
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should include the framework mixin" do
|
28
|
+
subject.should be_kind_of(Frameworks::Rails3)
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should include the server mixin" do
|
32
|
+
subject.should be_kind_of(Servers::Thin)
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
not YAML
|
File without changes
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'helpers/projects'
|
3
|
+
|
4
|
+
require 'deployml/project'
|
5
|
+
|
6
|
+
describe Project do
|
7
|
+
include Helpers::Projects
|
8
|
+
|
9
|
+
describe "new" do
|
10
|
+
it "should find deploy.yml in the 'config/' directory" do
|
11
|
+
lambda {
|
12
|
+
Project.new(project_dir(:basic))
|
13
|
+
}.should_not raise_error
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should raise ConfigNotFound when deploy.yml cannot be found" do
|
17
|
+
lambda {
|
18
|
+
Project.new(project_dir(:missing_config))
|
19
|
+
}.should raise_error(ConfigNotFound)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should raise InvalidConfig when deploy.yml does not contain a Hash" do
|
23
|
+
lambda {
|
24
|
+
Project.new(project_dir(:bad_config))
|
25
|
+
}.should raise_error(InvalidConfig)
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should raise InvalidConfig if :source is missing" do
|
29
|
+
lambda {
|
30
|
+
Project.new(project_dir(:missing_source))
|
31
|
+
}.should raise_error(InvalidConfig)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should raise InvalidConfig if :dest is missing" do
|
35
|
+
lambda {
|
36
|
+
Project.new(project_dir(:missing_dest))
|
37
|
+
}.should raise_error(InvalidConfig)
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should raise InvalidConfig if :server is unknown" do
|
41
|
+
lambda {
|
42
|
+
Project.new(project_dir(:invalid_server))
|
43
|
+
}.should raise_error(InvalidConfig)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should load the :production environment if thats the only env" do
|
47
|
+
project = Project.new(project_dir(:basic))
|
48
|
+
|
49
|
+
project.environments.keys.should == [:production]
|
50
|
+
end
|
51
|
+
|
52
|
+
it "should load multiple environments" do
|
53
|
+
project = Project.new(project_dir(:rails))
|
54
|
+
|
55
|
+
project.environments.keys.should =~ [:production, :staging]
|
56
|
+
end
|
57
|
+
|
58
|
+
it "should load the base config into multiple environments" do
|
59
|
+
project = Project.new(project_dir(:rails))
|
60
|
+
|
61
|
+
project.environments.all? { |name,env|
|
62
|
+
env.framework == :rails3 && env.orm == :datamapper
|
63
|
+
}.should == true
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,207 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: deployml
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
version: 0.3.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Postmodern
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-11-21 00:00:00 -08:00
|
18
|
+
default_executable: deployml
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: addressable
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 2
|
30
|
+
- 1
|
31
|
+
- 1
|
32
|
+
version: 2.1.1
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: rprogram
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
- 2
|
46
|
+
- 0
|
47
|
+
version: 0.2.0
|
48
|
+
type: :runtime
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: thor
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ~>
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
- 14
|
61
|
+
- 3
|
62
|
+
version: 0.14.3
|
63
|
+
type: :runtime
|
64
|
+
version_requirements: *id003
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
name: ore-tasks
|
67
|
+
prerelease: false
|
68
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ~>
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
- 3
|
76
|
+
- 0
|
77
|
+
version: 0.3.0
|
78
|
+
type: :development
|
79
|
+
version_requirements: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: rspec
|
82
|
+
prerelease: false
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ~>
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
segments:
|
89
|
+
- 2
|
90
|
+
- 1
|
91
|
+
- 0
|
92
|
+
version: 2.1.0
|
93
|
+
type: :development
|
94
|
+
version_requirements: *id005
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: yard
|
97
|
+
prerelease: false
|
98
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
segments:
|
104
|
+
- 0
|
105
|
+
- 6
|
106
|
+
- 0
|
107
|
+
version: 0.6.0
|
108
|
+
type: :development
|
109
|
+
version_requirements: *id006
|
110
|
+
description: DeploYML is a simple deployment solution that uses a single YAML file, Git and SSH.
|
111
|
+
email: postmodern.mod3@gmail.com
|
112
|
+
executables:
|
113
|
+
- deployml
|
114
|
+
extensions: []
|
115
|
+
|
116
|
+
extra_rdoc_files:
|
117
|
+
- README.md
|
118
|
+
- LICENSE.txt
|
119
|
+
- ChangeLog.md
|
120
|
+
files:
|
121
|
+
- .document
|
122
|
+
- .rspec
|
123
|
+
- .yardopts
|
124
|
+
- ChangeLog.md
|
125
|
+
- LICENSE.txt
|
126
|
+
- README.md
|
127
|
+
- Rakefile
|
128
|
+
- bin/deployml
|
129
|
+
- deployml.gemspec
|
130
|
+
- gemspec.yml
|
131
|
+
- lib/deployml.rb
|
132
|
+
- lib/deployml/cli.rb
|
133
|
+
- lib/deployml/configuration.rb
|
134
|
+
- lib/deployml/environment.rb
|
135
|
+
- lib/deployml/exceptions/config_not_found.rb
|
136
|
+
- lib/deployml/exceptions/invalid_config.rb
|
137
|
+
- lib/deployml/exceptions/missing_option.rb
|
138
|
+
- lib/deployml/exceptions/unknown_environment.rb
|
139
|
+
- lib/deployml/exceptions/unknown_framework.rb
|
140
|
+
- lib/deployml/exceptions/unknown_server.rb
|
141
|
+
- lib/deployml/frameworks.rb
|
142
|
+
- lib/deployml/frameworks/rails2.rb
|
143
|
+
- lib/deployml/frameworks/rails3.rb
|
144
|
+
- lib/deployml/local_shell.rb
|
145
|
+
- lib/deployml/options.rb
|
146
|
+
- lib/deployml/options/mongrel.rb
|
147
|
+
- lib/deployml/options/thin.rb
|
148
|
+
- lib/deployml/project.rb
|
149
|
+
- lib/deployml/remote_shell.rb
|
150
|
+
- lib/deployml/servers.rb
|
151
|
+
- lib/deployml/servers/apache.rb
|
152
|
+
- lib/deployml/servers/mongrel.rb
|
153
|
+
- lib/deployml/servers/thin.rb
|
154
|
+
- lib/deployml/shell.rb
|
155
|
+
- lib/deployml/version.rb
|
156
|
+
- spec/configuration_spec.rb
|
157
|
+
- spec/deployml_spec.rb
|
158
|
+
- spec/environment_spec.rb
|
159
|
+
- spec/helpers/projects.rb
|
160
|
+
- spec/helpers/projects/bad_config/config/deploy.yml
|
161
|
+
- spec/helpers/projects/basic/config/deploy.yml
|
162
|
+
- spec/helpers/projects/invalid_server/config/deploy.yml
|
163
|
+
- spec/helpers/projects/missing_config/.gitkeep
|
164
|
+
- spec/helpers/projects/missing_dest/config/deploy.yml
|
165
|
+
- spec/helpers/projects/missing_source/config/deploy.yml
|
166
|
+
- spec/helpers/projects/rails/config/deploy.yml
|
167
|
+
- spec/helpers/projects/rails/config/deploy/production.yml
|
168
|
+
- spec/helpers/projects/rails/config/deploy/staging.yml
|
169
|
+
- spec/project_spec.rb
|
170
|
+
- spec/spec_helper.rb
|
171
|
+
has_rdoc: yard
|
172
|
+
homepage: http://github.com/postmodern/deployml
|
173
|
+
licenses:
|
174
|
+
- MIT
|
175
|
+
post_install_message:
|
176
|
+
rdoc_options: []
|
177
|
+
|
178
|
+
require_paths:
|
179
|
+
- lib
|
180
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
181
|
+
none: false
|
182
|
+
requirements:
|
183
|
+
- - ">="
|
184
|
+
- !ruby/object:Gem::Version
|
185
|
+
segments:
|
186
|
+
- 0
|
187
|
+
version: "0"
|
188
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
189
|
+
none: false
|
190
|
+
requirements:
|
191
|
+
- - ">="
|
192
|
+
- !ruby/object:Gem::Version
|
193
|
+
segments:
|
194
|
+
- 0
|
195
|
+
version: "0"
|
196
|
+
requirements: []
|
197
|
+
|
198
|
+
rubyforge_project: deployml
|
199
|
+
rubygems_version: 1.3.7
|
200
|
+
signing_key:
|
201
|
+
specification_version: 3
|
202
|
+
summary: A simple deployment solution that works.
|
203
|
+
test_files:
|
204
|
+
- spec/project_spec.rb
|
205
|
+
- spec/environment_spec.rb
|
206
|
+
- spec/configuration_spec.rb
|
207
|
+
- spec/deployml_spec.rb
|