lobot 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/.rvmrc +1 -0
- data/Gemfile +9 -0
- data/LICENSE.txt +21 -0
- data/README.md +78 -0
- data/Rakefile +2 -0
- data/features/ci.feature +18 -0
- data/features/config/secrets.yml.example +6 -0
- data/features/step_definitions/ci_steps.rb +98 -0
- data/features/support/env.rb +3 -0
- data/lib/generators/lobot/USAGE +8 -0
- data/lib/generators/lobot/install_generator.rb +24 -0
- data/lib/generators/lobot/templates/Capfile +6 -0
- data/lib/generators/lobot/templates/bootstrap_server.sh +57 -0
- data/lib/generators/lobot/templates/capistrano-ci.rb +68 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/attributes/nginx.rb +2 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/libraries/ci_config.rb +2 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/default.rb +7 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/git_config.rb +11 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/id_rsa.rb +14 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/jenkins.rb +45 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/xvfb.rb +24 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/templates/default/jenkins-job-config.xml.erb +62 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/libraries/marker.rb +42 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/daemontools.rb +15 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/imagemagick.rb +37 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/libxml_prereqs.rb +14 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/mysql_5_1.rb +90 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/mysql_5_5.rb +86 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/nginx.rb +65 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/postgres.rb +80 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/sqlite.rb +20 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/swap.rb +17 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/nginx-conf.erb +42 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/nginx-htaccess.erb +3 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/nginx-mime-types.erb +75 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/nginx-run-script.erb +2 -0
- data/lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/postgres-run-script.erb +2 -0
- data/lib/generators/lobot/templates/ci.rake +111 -0
- data/lib/generators/lobot/templates/ci.yml +24 -0
- data/lib/generators/lobot/templates/deploy-ci.rb +5 -0
- data/lib/generators/lobot/templates/soloistrc +11 -0
- data/lib/lobot.rb +8 -0
- data/lib/lobot/version.rb +3 -0
- data/lobot.gemspec +27 -0
- data/spec/install_spec.rb +68 -0
- data/spec/spec_helper.rb +11 -0
- metadata +161 -0
data/lib/lobot.rb
ADDED
data/lobot.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "lobot/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "lobot"
|
7
|
+
s.version = Lobot::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.authors = ["Matthew Kocher", "Lee Edwards"]
|
10
|
+
s.email = ["gems@pivotallabs.com"]
|
11
|
+
s.homepage = "https://github.com/pivotal/lobot"
|
12
|
+
s.summary = %q{Lobot provides generators of chef recipes to set up CI easily.}
|
13
|
+
s.description = %q{Description coming soon}
|
14
|
+
|
15
|
+
s.rubyforge_project = "lobot"
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n")
|
18
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
|
22
|
+
s.add_dependency('fog', '0.9.0')
|
23
|
+
s.add_dependency('capistrano')
|
24
|
+
s.add_dependency('capistrano-ext')
|
25
|
+
s.add_dependency('rvm')
|
26
|
+
s.add_dependency('nokogiri', '>=1.4.4')
|
27
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Lobot::InstallGenerator do
|
4
|
+
include GeneratorSpec::TestCase
|
5
|
+
destination File.expand_path("../tmp", __FILE__)
|
6
|
+
# arguments %w(something)
|
7
|
+
|
8
|
+
before(:each) do
|
9
|
+
prepare_destination
|
10
|
+
run_generator
|
11
|
+
end
|
12
|
+
|
13
|
+
it "creates ci.yml" do
|
14
|
+
assert_file "config/ci.yml", /app_name/
|
15
|
+
end
|
16
|
+
|
17
|
+
it "creates ci.rake" do
|
18
|
+
assert_file "lib/tasks/ci.rake", /namespace :ci do/
|
19
|
+
end
|
20
|
+
|
21
|
+
it "create bootstrap_server.sh" do
|
22
|
+
assert_file "script/bootstrap_server.sh", /bin\/bash/
|
23
|
+
end
|
24
|
+
|
25
|
+
context "Capfile exists" do
|
26
|
+
it "appends a load path to the Capfile" do
|
27
|
+
prepare_destination
|
28
|
+
system("echo 'line 2' > #{destination_root}/Capfile")
|
29
|
+
run_generator
|
30
|
+
assert_file "Capfile", "load 'config/capistrano/ci'\nline 2\n"
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
context "Capfile doesn't exist" do
|
36
|
+
it "create a Capfile" do
|
37
|
+
assert_file "Capfile", /load 'config\/capistrano\/ci'/
|
38
|
+
end
|
39
|
+
|
40
|
+
it "give you the capify (default) capfile, but commented out" do
|
41
|
+
assert_file "Capfile", /# load 'deploy'/
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
it "creates config/deploy/ci.rb" do
|
46
|
+
assert_file "config/deploy/ci.rb", /role :ci, ci_server/
|
47
|
+
end
|
48
|
+
|
49
|
+
it "creates config/capistrano/ci.rb" do
|
50
|
+
assert_file "config/capistrano/ci.rb", /task :ci_setup do/
|
51
|
+
end
|
52
|
+
|
53
|
+
it "creates soloistrc" do
|
54
|
+
assert_file "soloistrc", /cookbook_paths/
|
55
|
+
end
|
56
|
+
|
57
|
+
it "creates the chef directory" do
|
58
|
+
destination_root.should have_structure do
|
59
|
+
directory "chef" do
|
60
|
+
directory "cookbooks" do
|
61
|
+
directory "pivotal_ci"
|
62
|
+
directory "pivotal_server"
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
require 'rails/generators'
|
5
|
+
|
6
|
+
require File.expand_path('../lib/lobot', File.dirname(__FILE__))
|
7
|
+
|
8
|
+
require 'generator_spec/test_case'
|
9
|
+
|
10
|
+
require 'generator_spec'
|
11
|
+
require File.expand_path('../../lib/generators/lobot/install_generator.rb', __FILE__)
|
metadata
ADDED
@@ -0,0 +1,161 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lobot
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: 0.9.0
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Matthew Kocher
|
9
|
+
- Lee Edwards
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
|
14
|
+
date: 2011-07-21 00:00:00 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: fog
|
18
|
+
prerelease: false
|
19
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
21
|
+
requirements:
|
22
|
+
- - "="
|
23
|
+
- !ruby/object:Gem::Version
|
24
|
+
version: 0.9.0
|
25
|
+
type: :runtime
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: capistrano
|
29
|
+
prerelease: false
|
30
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ">="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: "0"
|
36
|
+
type: :runtime
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: capistrano-ext
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: "0"
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id003
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: rvm
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: "0"
|
58
|
+
type: :runtime
|
59
|
+
version_requirements: *id004
|
60
|
+
- !ruby/object:Gem::Dependency
|
61
|
+
name: nokogiri
|
62
|
+
prerelease: false
|
63
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.4.4
|
69
|
+
type: :runtime
|
70
|
+
version_requirements: *id005
|
71
|
+
description: Description coming soon
|
72
|
+
email:
|
73
|
+
- gems@pivotallabs.com
|
74
|
+
executables: []
|
75
|
+
|
76
|
+
extensions: []
|
77
|
+
|
78
|
+
extra_rdoc_files: []
|
79
|
+
|
80
|
+
files:
|
81
|
+
- .gitignore
|
82
|
+
- .rvmrc
|
83
|
+
- Gemfile
|
84
|
+
- LICENSE.txt
|
85
|
+
- README.md
|
86
|
+
- Rakefile
|
87
|
+
- features/ci.feature
|
88
|
+
- features/config/secrets.yml.example
|
89
|
+
- features/step_definitions/ci_steps.rb
|
90
|
+
- features/support/env.rb
|
91
|
+
- lib/generators/lobot/USAGE
|
92
|
+
- lib/generators/lobot/install_generator.rb
|
93
|
+
- lib/generators/lobot/templates/Capfile
|
94
|
+
- lib/generators/lobot/templates/bootstrap_server.sh
|
95
|
+
- lib/generators/lobot/templates/capistrano-ci.rb
|
96
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/attributes/nginx.rb
|
97
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/libraries/ci_config.rb
|
98
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/default.rb
|
99
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/git_config.rb
|
100
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/id_rsa.rb
|
101
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/jenkins.rb
|
102
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/recipes/xvfb.rb
|
103
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_ci/templates/default/jenkins-job-config.xml.erb
|
104
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/libraries/marker.rb
|
105
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/daemontools.rb
|
106
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/imagemagick.rb
|
107
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/libxml_prereqs.rb
|
108
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/mysql_5_1.rb
|
109
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/mysql_5_5.rb
|
110
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/nginx.rb
|
111
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/postgres.rb
|
112
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/sqlite.rb
|
113
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/recipes/swap.rb
|
114
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/nginx-conf.erb
|
115
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/nginx-htaccess.erb
|
116
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/nginx-mime-types.erb
|
117
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/nginx-run-script.erb
|
118
|
+
- lib/generators/lobot/templates/chef/cookbooks/pivotal_server/templates/default/postgres-run-script.erb
|
119
|
+
- lib/generators/lobot/templates/ci.rake
|
120
|
+
- lib/generators/lobot/templates/ci.yml
|
121
|
+
- lib/generators/lobot/templates/deploy-ci.rb
|
122
|
+
- lib/generators/lobot/templates/soloistrc
|
123
|
+
- lib/lobot.rb
|
124
|
+
- lib/lobot/version.rb
|
125
|
+
- lobot.gemspec
|
126
|
+
- spec/install_spec.rb
|
127
|
+
- spec/spec_helper.rb
|
128
|
+
homepage: https://github.com/pivotal/lobot
|
129
|
+
licenses: []
|
130
|
+
|
131
|
+
post_install_message:
|
132
|
+
rdoc_options: []
|
133
|
+
|
134
|
+
require_paths:
|
135
|
+
- lib
|
136
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ">="
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: "0"
|
142
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
143
|
+
none: false
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: "0"
|
148
|
+
requirements: []
|
149
|
+
|
150
|
+
rubyforge_project: lobot
|
151
|
+
rubygems_version: 1.8.5
|
152
|
+
signing_key:
|
153
|
+
specification_version: 3
|
154
|
+
summary: Lobot provides generators of chef recipes to set up CI easily.
|
155
|
+
test_files:
|
156
|
+
- features/ci.feature
|
157
|
+
- features/config/secrets.yml.example
|
158
|
+
- features/step_definitions/ci_steps.rb
|
159
|
+
- features/support/env.rb
|
160
|
+
- spec/install_spec.rb
|
161
|
+
- spec/spec_helper.rb
|