gitpusshuten 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.bundle/config +2 -0
- data/.gitignore +4 -0
- data/Gemfile +9 -0
- data/Gemfile.lock +53 -0
- data/README.md +7 -0
- data/bin/gitpusshuten +4 -0
- data/bin/heavenly +4 -0
- data/bin/ten +4 -0
- data/gitpusshuten.gemspec +26 -0
- data/lib/gitpusshuten/cli.rb +78 -0
- data/lib/gitpusshuten/command.rb +147 -0
- data/lib/gitpusshuten/commands/base.rb +246 -0
- data/lib/gitpusshuten/commands/delete.rb +27 -0
- data/lib/gitpusshuten/commands/help.rb +36 -0
- data/lib/gitpusshuten/commands/initialize.rb +61 -0
- data/lib/gitpusshuten/commands/push.rb +54 -0
- data/lib/gitpusshuten/commands/remote.rb +29 -0
- data/lib/gitpusshuten/commands/user.rb +252 -0
- data/lib/gitpusshuten/commands/version.rb +21 -0
- data/lib/gitpusshuten/configuration.rb +122 -0
- data/lib/gitpusshuten/environment.rb +70 -0
- data/lib/gitpusshuten/gem.rb +33 -0
- data/lib/gitpusshuten/git.rb +111 -0
- data/lib/gitpusshuten/helpers/environment/installers.rb +59 -0
- data/lib/gitpusshuten/helpers/environment/packages.rb +21 -0
- data/lib/gitpusshuten/helpers/environment/scp.rb +57 -0
- data/lib/gitpusshuten/helpers/environment/ssh.rb +77 -0
- data/lib/gitpusshuten/helpers/environment/ssh_key.rb +79 -0
- data/lib/gitpusshuten/helpers/environment/user.rb +70 -0
- data/lib/gitpusshuten/helpers/spinner.rb +98 -0
- data/lib/gitpusshuten/hook.rb +26 -0
- data/lib/gitpusshuten/hooks.rb +147 -0
- data/lib/gitpusshuten/initializer.rb +95 -0
- data/lib/gitpusshuten/local.rb +35 -0
- data/lib/gitpusshuten/log.rb +83 -0
- data/lib/gitpusshuten/modules/active_record/hooks.rb +19 -0
- data/lib/gitpusshuten/modules/apache/command.rb +354 -0
- data/lib/gitpusshuten/modules/bundler/command.rb +43 -0
- data/lib/gitpusshuten/modules/bundler/hooks.rb +8 -0
- data/lib/gitpusshuten/modules/mysql/command.rb +192 -0
- data/lib/gitpusshuten/modules/nanoc/hooks.rb +9 -0
- data/lib/gitpusshuten/modules/nginx/command.rb +447 -0
- data/lib/gitpusshuten/modules/passenger/command.rb +310 -0
- data/lib/gitpusshuten/modules/passenger/hooks.rb +4 -0
- data/lib/gitpusshuten/modules/rvm/command.rb +277 -0
- data/lib/gitpusshuten.rb +21 -0
- data/lib/templates/config.rb +37 -0
- data/lib/templates/hooks.rb +40 -0
- data/spec/cli_spec.rb +83 -0
- data/spec/command_spec.rb +76 -0
- data/spec/configuration_spec.rb +45 -0
- data/spec/environment_spec.rb +64 -0
- data/spec/fixtures/combined_hooks.rb +23 -0
- data/spec/fixtures/config.rb +23 -0
- data/spec/fixtures/hooks.rb +37 -0
- data/spec/fixtures/passenger.json +1 -0
- data/spec/gem_spec.rb +28 -0
- data/spec/git_spec.rb +59 -0
- data/spec/gitpusshuten_spec.rb +9 -0
- data/spec/hook_spec.rb +48 -0
- data/spec/hooks_spec.rb +150 -0
- data/spec/initializer_spec.rb +26 -0
- data/spec/log_spec.rb +20 -0
- data/spec/spec_helper.rb +43 -0
- metadata +220 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GitPusshuTen::Initializer do
|
4
|
+
|
5
|
+
let(:command) { mock('command') }
|
6
|
+
let(:configuration) { mock('configuration') }
|
7
|
+
let(:hooks) { mock('hooks') }
|
8
|
+
|
9
|
+
before do
|
10
|
+
command.stubs(:perform!)
|
11
|
+
configuration.stubs(:strip)
|
12
|
+
configuration.stubs(:to_ary)
|
13
|
+
GitPusshuTen::Configuration.any_instance.stubs(:parse!)
|
14
|
+
GitPusshuTen::Hooks.any_instance.stubs(:parse!).returns(hooks)
|
15
|
+
hooks.expects(:parse_modules!).returns(hooks)
|
16
|
+
GitPusshuTen::Hooks.any_instance.stubs(:parse_modules!)
|
17
|
+
GitPusshuTen::Command.stubs(:new).returns(command)
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should output an error if config file could not be found" do
|
21
|
+
GitPusshuTen::Initializer.any_instance.expects(:exit)
|
22
|
+
GitPusshuTen::Log.expects(:error)
|
23
|
+
GitPusshuTen::Initializer.new(%w[tag 1.4.2 to staging], configuration)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
data/spec/log_spec.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GitPusshuTen::Log do
|
4
|
+
|
5
|
+
it "should log a message" do
|
6
|
+
GitPusshuTen::Log.expects(:puts).with("[message] heavenly message")
|
7
|
+
GitPusshuTen::Log.message("heavenly message")
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should log a message" do
|
11
|
+
GitPusshuTen::Log.expects(:puts).with("[warning] heavenly message")
|
12
|
+
GitPusshuTen::Log.warning("heavenly message")
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should log a message" do
|
16
|
+
GitPusshuTen::Log.expects(:puts).with("[error] heavenly message")
|
17
|
+
GitPusshuTen::Log.error("heavenly message")
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'gitpusshuten'
|
2
|
+
|
3
|
+
RSpec.configure do |config|
|
4
|
+
config.mock_with :mocha
|
5
|
+
end
|
6
|
+
|
7
|
+
|
8
|
+
##
|
9
|
+
# GitPusshuTen::Command Mock
|
10
|
+
module GitPusshuTen
|
11
|
+
module Commands
|
12
|
+
class NonExistingCommand < GitPusshuTen::Commands::Base
|
13
|
+
def initialize(cli, configuration, hooks, environment)
|
14
|
+
super
|
15
|
+
self
|
16
|
+
end
|
17
|
+
|
18
|
+
def perform!
|
19
|
+
self
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def command_setup!(klass, argv)
|
26
|
+
let(:configuration_file) { File.expand_path(File.dirname(__FILE__) + '/fixtures/config.rb') }
|
27
|
+
let(:hooks_file) { File.expand_path(File.dirname(__FILE__) + '/fixtures/hooks.rb') }
|
28
|
+
|
29
|
+
let(:cli) { GitPusshuTen::CLI.new(argv) }
|
30
|
+
let(:configuration) { GitPusshuTen::Configuration.new(cli.environment).parse!(configuration_file) }
|
31
|
+
let(:hooks) { GitPusshuTen::Hooks.new(cli.environment, configuration_file).parse!(hooks_file) }
|
32
|
+
let(:environment) { GitPusshuTen::Environment.new(configuration) }
|
33
|
+
let(:command) { "GitPusshuTen::Commands::#{klass}".constantize.new(cli, configuration, hooks, environment) }
|
34
|
+
let(:git) { GitPusshuTen::Git.new }
|
35
|
+
let(:local) { GitPusshuTen::Local.new }
|
36
|
+
|
37
|
+
before do
|
38
|
+
command.stubs(:git).returns(git)
|
39
|
+
git.stubs(:git)
|
40
|
+
command.stubs(:local).returns(local)
|
41
|
+
git.stubs(:local)
|
42
|
+
end
|
43
|
+
end
|
metadata
ADDED
@@ -0,0 +1,220 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gitpusshuten
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Michael van Rooijen
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-11-19 00:00:00 +01:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: rainbow
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 1
|
30
|
+
- 1
|
31
|
+
- 0
|
32
|
+
version: 1.1.0
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: highline
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
segments:
|
44
|
+
- 1
|
45
|
+
- 6
|
46
|
+
- 0
|
47
|
+
version: 1.6.0
|
48
|
+
type: :runtime
|
49
|
+
version_requirements: *id002
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: net-ssh
|
52
|
+
prerelease: false
|
53
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
54
|
+
none: false
|
55
|
+
requirements:
|
56
|
+
- - ~>
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
segments:
|
59
|
+
- 2
|
60
|
+
- 0
|
61
|
+
- 0
|
62
|
+
version: 2.0.0
|
63
|
+
type: :runtime
|
64
|
+
version_requirements: *id003
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
name: net-scp
|
67
|
+
prerelease: false
|
68
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
70
|
+
requirements:
|
71
|
+
- - ~>
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
segments:
|
74
|
+
- 1
|
75
|
+
- 0
|
76
|
+
- 0
|
77
|
+
version: 1.0.0
|
78
|
+
type: :runtime
|
79
|
+
version_requirements: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: activesupport
|
82
|
+
prerelease: false
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ~>
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
segments:
|
89
|
+
- 3
|
90
|
+
- 0
|
91
|
+
- 0
|
92
|
+
version: 3.0.0
|
93
|
+
type: :runtime
|
94
|
+
version_requirements: *id005
|
95
|
+
- !ruby/object:Gem::Dependency
|
96
|
+
name: json
|
97
|
+
prerelease: false
|
98
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
segments:
|
104
|
+
- 1
|
105
|
+
- 4
|
106
|
+
- 0
|
107
|
+
version: 1.4.0
|
108
|
+
type: :runtime
|
109
|
+
version_requirements: *id006
|
110
|
+
description: |-
|
111
|
+
A Git-based application deployment tool that allows you to define your environment
|
112
|
+
by utilizing modules and provision your server with basic deployment needs.
|
113
|
+
email: meskyanichi@gmail.com
|
114
|
+
executables:
|
115
|
+
- gitpusshuten
|
116
|
+
- heavenly
|
117
|
+
- ten
|
118
|
+
extensions: []
|
119
|
+
|
120
|
+
extra_rdoc_files: []
|
121
|
+
|
122
|
+
files:
|
123
|
+
- .bundle/config
|
124
|
+
- .gitignore
|
125
|
+
- Gemfile
|
126
|
+
- Gemfile.lock
|
127
|
+
- README.md
|
128
|
+
- bin/gitpusshuten
|
129
|
+
- bin/heavenly
|
130
|
+
- bin/ten
|
131
|
+
- gitpusshuten.gemspec
|
132
|
+
- lib/gitpusshuten.rb
|
133
|
+
- lib/gitpusshuten/cli.rb
|
134
|
+
- lib/gitpusshuten/command.rb
|
135
|
+
- lib/gitpusshuten/commands/base.rb
|
136
|
+
- lib/gitpusshuten/commands/delete.rb
|
137
|
+
- lib/gitpusshuten/commands/help.rb
|
138
|
+
- lib/gitpusshuten/commands/initialize.rb
|
139
|
+
- lib/gitpusshuten/commands/push.rb
|
140
|
+
- lib/gitpusshuten/commands/remote.rb
|
141
|
+
- lib/gitpusshuten/commands/user.rb
|
142
|
+
- lib/gitpusshuten/commands/version.rb
|
143
|
+
- lib/gitpusshuten/configuration.rb
|
144
|
+
- lib/gitpusshuten/environment.rb
|
145
|
+
- lib/gitpusshuten/gem.rb
|
146
|
+
- lib/gitpusshuten/git.rb
|
147
|
+
- lib/gitpusshuten/helpers/environment/installers.rb
|
148
|
+
- lib/gitpusshuten/helpers/environment/packages.rb
|
149
|
+
- lib/gitpusshuten/helpers/environment/scp.rb
|
150
|
+
- lib/gitpusshuten/helpers/environment/ssh.rb
|
151
|
+
- lib/gitpusshuten/helpers/environment/ssh_key.rb
|
152
|
+
- lib/gitpusshuten/helpers/environment/user.rb
|
153
|
+
- lib/gitpusshuten/helpers/spinner.rb
|
154
|
+
- lib/gitpusshuten/hook.rb
|
155
|
+
- lib/gitpusshuten/hooks.rb
|
156
|
+
- lib/gitpusshuten/initializer.rb
|
157
|
+
- lib/gitpusshuten/local.rb
|
158
|
+
- lib/gitpusshuten/log.rb
|
159
|
+
- lib/gitpusshuten/modules/active_record/hooks.rb
|
160
|
+
- lib/gitpusshuten/modules/apache/command.rb
|
161
|
+
- lib/gitpusshuten/modules/bundler/command.rb
|
162
|
+
- lib/gitpusshuten/modules/bundler/hooks.rb
|
163
|
+
- lib/gitpusshuten/modules/mysql/command.rb
|
164
|
+
- lib/gitpusshuten/modules/nanoc/hooks.rb
|
165
|
+
- lib/gitpusshuten/modules/nginx/command.rb
|
166
|
+
- lib/gitpusshuten/modules/passenger/command.rb
|
167
|
+
- lib/gitpusshuten/modules/passenger/hooks.rb
|
168
|
+
- lib/gitpusshuten/modules/rvm/command.rb
|
169
|
+
- lib/templates/config.rb
|
170
|
+
- lib/templates/hooks.rb
|
171
|
+
- spec/cli_spec.rb
|
172
|
+
- spec/command_spec.rb
|
173
|
+
- spec/configuration_spec.rb
|
174
|
+
- spec/environment_spec.rb
|
175
|
+
- spec/fixtures/combined_hooks.rb
|
176
|
+
- spec/fixtures/config.rb
|
177
|
+
- spec/fixtures/hooks.rb
|
178
|
+
- spec/fixtures/passenger.json
|
179
|
+
- spec/gem_spec.rb
|
180
|
+
- spec/git_spec.rb
|
181
|
+
- spec/gitpusshuten_spec.rb
|
182
|
+
- spec/hook_spec.rb
|
183
|
+
- spec/hooks_spec.rb
|
184
|
+
- spec/initializer_spec.rb
|
185
|
+
- spec/log_spec.rb
|
186
|
+
- spec/spec_helper.rb
|
187
|
+
has_rdoc: true
|
188
|
+
homepage: http://gitpusshuten.com/
|
189
|
+
licenses: []
|
190
|
+
|
191
|
+
post_install_message:
|
192
|
+
rdoc_options: []
|
193
|
+
|
194
|
+
require_paths:
|
195
|
+
- lib
|
196
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
197
|
+
none: false
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
segments:
|
202
|
+
- 0
|
203
|
+
version: "0"
|
204
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
205
|
+
none: false
|
206
|
+
requirements:
|
207
|
+
- - ">="
|
208
|
+
- !ruby/object:Gem::Version
|
209
|
+
segments:
|
210
|
+
- 0
|
211
|
+
version: "0"
|
212
|
+
requirements: []
|
213
|
+
|
214
|
+
rubyforge_project:
|
215
|
+
rubygems_version: 1.3.7
|
216
|
+
signing_key:
|
217
|
+
specification_version: 3
|
218
|
+
summary: Heavenly Git-based Application Deployment.
|
219
|
+
test_files: []
|
220
|
+
|