bixby-provision 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +29 -0
  3. data/Gemfile.lock +192 -0
  4. data/Rakefile +13 -0
  5. data/VERSION +1 -0
  6. data/Vagrantfile +64 -0
  7. data/bin/bixby-provision +6 -0
  8. data/bixby-provision.gemspec +113 -0
  9. data/lib/bixby-provision.rb +2 -0
  10. data/lib/bixby/provision.rb +65 -0
  11. data/lib/bixby/provision/app.rb +34 -0
  12. data/lib/bixby/provision/dsl.rb +23 -0
  13. data/lib/bixby/provision/dsl/base.rb +76 -0
  14. data/lib/bixby/provision/dsl/bundler.rb +18 -0
  15. data/lib/bixby/provision/dsl/config.rb +124 -0
  16. data/lib/bixby/provision/dsl/dir.rb +34 -0
  17. data/lib/bixby/provision/dsl/file.rb +108 -0
  18. data/lib/bixby/provision/dsl/inventory.rb +18 -0
  19. data/lib/bixby/provision/dsl/meteor.rb +30 -0
  20. data/lib/bixby/provision/dsl/nodejs.rb +73 -0
  21. data/lib/bixby/provision/dsl/npm.rb +18 -0
  22. data/lib/bixby/provision/dsl/ntp.rb +41 -0
  23. data/lib/bixby/provision/dsl/packager/apt.rb +46 -0
  24. data/lib/bixby/provision/dsl/packager/base.rb +11 -0
  25. data/lib/bixby/provision/dsl/packager/npm.rb +67 -0
  26. data/lib/bixby/provision/dsl/packager/yum.rb +100 -0
  27. data/lib/bixby/provision/dsl/packager/yum/epel.rb +71 -0
  28. data/lib/bixby/provision/dsl/packager/yum/mongodb.rb +43 -0
  29. data/lib/bixby/provision/dsl/ruby.rb +21 -0
  30. data/lib/bixby/provision/dsl/run_control.rb +49 -0
  31. data/lib/bixby/provision/dsl/scm.rb +34 -0
  32. data/lib/bixby/provision/dsl/scm/base.rb +11 -0
  33. data/lib/bixby/provision/dsl/scm/git.rb +89 -0
  34. data/lib/bixby/provision/dsl/scm/svn.rb +11 -0
  35. data/lib/bixby/provision/dsl/service.rb +56 -0
  36. data/lib/bixby/provision/dsl/services/base.rb +11 -0
  37. data/lib/bixby/provision/dsl/services/init.rb +40 -0
  38. data/lib/bixby/provision/dsl/system.rb +53 -0
  39. data/lib/bixby/provision/dsl/util/file.rb +100 -0
  40. data/lib/bixby/provision/dsl/variable.rb +27 -0
  41. data/lib/bixby/provision/manifest.rb +49 -0
  42. data/lib/bixby/provision/manifest/dsl_proxy.rb +17 -0
  43. data/manifest.rb +31 -0
  44. data/tasks/coverage.rake +2 -0
  45. data/tasks/jeweler.rake +21 -0
  46. data/tasks/test.rake +5 -0
  47. data/tasks/yard.rake +2 -0
  48. metadata +244 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0ba568046715c4961e98e68f835fa4a82cad8d56
4
+ data.tar.gz: bc87c9560347028af778f2930a77e2149d0b9373
5
+ SHA512:
6
+ metadata.gz: ddab3172178812f7baf9a67106d74bf4a862a01a0ae7722757a5ca48b76bb3a397aa8f450d7d0bea3a0a5a319a31af068fa2cda82a29d09d78e8219459d337c3
7
+ data.tar.gz: b4da7509694b1febb87e56feb0b21b3ef6f192d4fd1c7770d88b88ba604d38342256dd39805921d60091bf1f01a1009db7a7d9fc7a32764e1578d85dd903db01
data/Gemfile ADDED
@@ -0,0 +1,29 @@
1
+
2
+ source "https://rubygems.org"
3
+
4
+ group :self do
5
+ gem 'bixby-provision', :path => "."
6
+ end
7
+
8
+ gem "bixby-client"
9
+ # gem "bixby-client", :path => "../client"
10
+ gem "api-auth", :github => "chetan/api_auth", :branch => "bixby"
11
+ gem "mixlib-shellout", "~> 1.3.0"
12
+
13
+ # required by various DSLs
14
+ gem "git", "~> 1.2.6"
15
+ gem "tilt", "~> 2.0"
16
+
17
+ group :development do
18
+ # packaging
19
+ gem 'jeweler', :github => "chetan/jeweler", :branch => "bixby"
20
+ gem 'yard', '~> 0.7'
21
+
22
+ # debugging
23
+ gem 'pry'
24
+ gem 'awesome_print'
25
+
26
+ # tools
27
+ gem "test_guard", :github => "chetan/test_guard"
28
+ gem "micron", :github => "chetan/micron"
29
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,192 @@
1
+ GIT
2
+ remote: git://github.com/chetan/api_auth.git
3
+ revision: 2ced7ba3afcc4d81e8a24e3d89f569b38b1e10a0
4
+ branch: bixby
5
+ specs:
6
+ api-auth (1.0.3)
7
+
8
+ GIT
9
+ remote: git://github.com/chetan/jeweler.git
10
+ revision: b1f048d0ee6bc9febbcadb52b75b77e734782eb4
11
+ branch: bixby
12
+ specs:
13
+ jeweler (2.0.1)
14
+ builder
15
+ bundler (>= 1.0)
16
+ git (>= 1.2.5)
17
+ github_api
18
+ highline (>= 1.6.15)
19
+ nokogiri (>= 1.5.10)
20
+ rake
21
+ rdoc
22
+
23
+ GIT
24
+ remote: git://github.com/chetan/micron.git
25
+ revision: 17e46aaf88e16870fa4ac0374016434823c2c46e
26
+ specs:
27
+ micron (0.5.0)
28
+ ansi
29
+ easycov
30
+ hitimes
31
+
32
+ GIT
33
+ remote: git://github.com/chetan/test_guard.git
34
+ revision: 178e47e2e57dc83060d6cabc18f206916b9d02f2
35
+ specs:
36
+ test_guard (0.2.1)
37
+ awesome_print
38
+ easycov
39
+ growl
40
+ listen
41
+ simplecov
42
+ simplecov-console
43
+
44
+ PATH
45
+ remote: .
46
+ specs:
47
+ bixby-provision (0.1.0)
48
+ api-auth
49
+ bixby-client
50
+ git (~> 1.2.6)
51
+ mixlib-shellout (~> 1.3.0)
52
+ tilt (~> 2.0)
53
+
54
+ GEM
55
+ remote: https://rubygems.org/
56
+ specs:
57
+ addressable (2.3.6)
58
+ ansi (1.4.3)
59
+ atomic (1.1.16)
60
+ awesome_print (1.2.0)
61
+ bixby-client (0.4.1)
62
+ api-auth
63
+ bixby-common
64
+ curb
65
+ fuzzy_file_finder
66
+ httpi
67
+ mixlib-shellout
68
+ multi_json
69
+ oj
70
+ bixby-common (0.4.12)
71
+ api-auth
72
+ faye-websocket
73
+ httpi
74
+ logging
75
+ multi_json
76
+ semver2
77
+ builder (3.2.2)
78
+ celluloid (0.15.2)
79
+ timers (~> 1.1.0)
80
+ celluloid-io (0.15.0)
81
+ celluloid (>= 0.15.0)
82
+ nio4r (>= 0.5.0)
83
+ coderay (1.1.0)
84
+ colorize (0.7.0)
85
+ curb (0.8.5)
86
+ descendants_tracker (0.0.4)
87
+ thread_safe (~> 0.3, >= 0.3.1)
88
+ docile (1.1.3)
89
+ easycov (0.4.0)
90
+ multi_json
91
+ simplecov
92
+ simplecov-console
93
+ simplecov-html
94
+ eventmachine (1.0.3)
95
+ faraday (0.9.0)
96
+ multipart-post (>= 1.2, < 3)
97
+ faye-websocket (0.7.2)
98
+ eventmachine (>= 0.12.0)
99
+ websocket-driver (>= 0.3.1)
100
+ ffi (1.9.3)
101
+ fuzzy_file_finder (1.0.4)
102
+ git (1.2.6)
103
+ github_api (0.11.3)
104
+ addressable (~> 2.3)
105
+ descendants_tracker (~> 0.0.1)
106
+ faraday (~> 0.8, < 0.10)
107
+ hashie (>= 1.2)
108
+ multi_json (>= 1.7.5, < 2.0)
109
+ nokogiri (~> 1.6.0)
110
+ oauth2
111
+ growl (1.0.3)
112
+ hashie (2.0.5)
113
+ highline (1.6.21)
114
+ hirb (0.7.1)
115
+ hitimes (1.2.1)
116
+ httpi (2.1.0)
117
+ rack
118
+ rubyntlm (~> 0.3.2)
119
+ json (1.8.1)
120
+ jwt (0.1.11)
121
+ multi_json (>= 1.5)
122
+ listen (2.7.1)
123
+ celluloid (>= 0.15.2)
124
+ celluloid-io (>= 0.15.0)
125
+ rb-fsevent (>= 0.9.3)
126
+ rb-inotify (>= 0.9)
127
+ little-plugger (1.1.3)
128
+ logging (1.8.2)
129
+ little-plugger (>= 1.1.3)
130
+ multi_json (>= 1.8.4)
131
+ method_source (0.8.2)
132
+ mini_portile (0.5.3)
133
+ mixlib-shellout (1.3.0)
134
+ multi_json (1.9.2)
135
+ multi_xml (0.5.5)
136
+ multipart-post (2.0.0)
137
+ nio4r (1.0.0)
138
+ nokogiri (1.6.1)
139
+ mini_portile (~> 0.5.0)
140
+ oauth2 (0.9.3)
141
+ faraday (>= 0.8, < 0.10)
142
+ jwt (~> 0.1.8)
143
+ multi_json (~> 1.3)
144
+ multi_xml (~> 0.5)
145
+ rack (~> 1.2)
146
+ oj (2.7.3)
147
+ pry (0.9.12.6)
148
+ coderay (~> 1.0)
149
+ method_source (~> 0.8)
150
+ slop (~> 3.4)
151
+ rack (1.5.2)
152
+ rake (10.2.2)
153
+ rb-fsevent (0.9.4)
154
+ rb-inotify (0.9.3)
155
+ ffi (>= 0.5.0)
156
+ rdoc (4.1.1)
157
+ json (~> 1.4)
158
+ rubyntlm (0.3.4)
159
+ semver2 (3.3.3)
160
+ simplecov (0.8.2)
161
+ docile (~> 1.1.0)
162
+ multi_json
163
+ simplecov-html (~> 0.8.0)
164
+ simplecov-console (0.1.3)
165
+ colorize
166
+ hirb
167
+ simplecov
168
+ simplecov-html (0.8.0)
169
+ slop (3.5.0)
170
+ thread_safe (0.3.1)
171
+ atomic (>= 1.1.7, < 2)
172
+ tilt (2.0.1)
173
+ timers (1.1.0)
174
+ websocket-driver (0.3.2)
175
+ yard (0.8.7.4)
176
+
177
+ PLATFORMS
178
+ ruby
179
+
180
+ DEPENDENCIES
181
+ api-auth!
182
+ awesome_print
183
+ bixby-client
184
+ bixby-provision!
185
+ git (~> 1.2.6)
186
+ jeweler!
187
+ micron!
188
+ mixlib-shellout (~> 1.3.0)
189
+ pry
190
+ test_guard!
191
+ tilt (~> 2.0)
192
+ yard (~> 0.7)
data/Rakefile ADDED
@@ -0,0 +1,13 @@
1
+
2
+ require 'rubygems'
3
+ require 'bundler'
4
+ begin
5
+ Bundler.setup(:default, :development)
6
+ rescue Bundler::BundlerError => e
7
+ $stderr.puts e.message
8
+ $stderr.puts "Run `bundle install` to install missing gems"
9
+ exit e.status_code
10
+ end
11
+ require 'rake'
12
+
13
+ Dir['tasks/**/*.rake'].each { |rake| load rake }
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
data/Vagrantfile ADDED
@@ -0,0 +1,64 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ Vagrant.configure("2") do |config|
5
+
6
+ config.vm.define("testing") do |cfg|
7
+ cfg.vm.provider :virtualbox do |vb, override|
8
+ # see: https://github.com/opscode/bento
9
+ override.vm.box = "ubuntu-12.04-x86_64"
10
+ override.vm.box_url = "https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box"
11
+ end
12
+ end
13
+
14
+ config.vm.define("testing-centos") do |cfg|
15
+ cfg.vm.provider :virtualbox do |vb, override|
16
+ override.vm.box = "chef/centos-6.5"
17
+ end
18
+ end
19
+
20
+ # common settings
21
+
22
+ # config.vm.provision "shell", :privileged => false, :path => "scripts/bootstrap.sh"
23
+
24
+ # for vagrant-vbguest plugin
25
+ # https://github.com/dotless-de/vagrant-vbguest
26
+ # config.vbguest.iso_path = "#{ENV['HOME']}/downloads/VBoxGuestAdditions_%{version}.iso"
27
+
28
+ # shared folders
29
+ config.vm.synced_folder ".", "/opt/bixby-provision"
30
+ config.vm.synced_folder "../common", "/opt/bixby-common"
31
+ config.vm.synced_folder "../client", "/opt/bixby-client"
32
+
33
+ # Enable SSH agent forwarding for git clones
34
+ config.ssh.forward_agent = true
35
+
36
+ config.vm.provider :virtualbox do |vb|
37
+ vb.gui = false # Boot headless
38
+ vb.customize [
39
+ "modifyvm", :id,
40
+ "--memory", "1024",
41
+ "--cpus", "1",
42
+ "--usb", "off",
43
+ "--usbehci", "off",
44
+ "--audio", "none"
45
+ ]
46
+ end
47
+
48
+ config.vm.provider :aws do |aws, override|
49
+ aws.region = "us-east-1"
50
+ aws.instance_type = "c3.large"
51
+ aws.security_groups = %w{ssh}
52
+
53
+ override.vm.box = "dummy"
54
+ override.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
55
+ end
56
+
57
+ config.vm.provider :digital_ocean do |ocean, override|
58
+ ocean.region = "New York 2"
59
+ ocean.size = "2GB"
60
+ ocean.setup = true
61
+
62
+ override.ssh.username = "bixby"
63
+ end
64
+ end
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bixby/provision"
4
+ require "bixby/provision/app"
5
+
6
+ Bixby::Provision::App.new.run!
@@ -0,0 +1,113 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+ # stub: bixby-provision 0.1.0 ruby lib
6
+
7
+ Gem::Specification.new do |s|
8
+ s.name = "bixby-provision"
9
+ s.version = "0.1.0"
10
+
11
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
13
+ s.authors = ["Chetan Sarva"]
14
+ s.date = "2014-05-02"
15
+ s.description = "Bixby Provisioner"
16
+ s.email = "chetan@pixelcop.net"
17
+ s.executables = ["bixby-provision"]
18
+ s.files = [
19
+ "Gemfile",
20
+ "Gemfile.lock",
21
+ "Rakefile",
22
+ "VERSION",
23
+ "Vagrantfile",
24
+ "bin/bixby-provision",
25
+ "bixby-provision.gemspec",
26
+ "lib/bixby-provision.rb",
27
+ "lib/bixby/provision.rb",
28
+ "lib/bixby/provision/app.rb",
29
+ "lib/bixby/provision/dsl.rb",
30
+ "lib/bixby/provision/dsl/base.rb",
31
+ "lib/bixby/provision/dsl/bundler.rb",
32
+ "lib/bixby/provision/dsl/config.rb",
33
+ "lib/bixby/provision/dsl/dir.rb",
34
+ "lib/bixby/provision/dsl/file.rb",
35
+ "lib/bixby/provision/dsl/inventory.rb",
36
+ "lib/bixby/provision/dsl/meteor.rb",
37
+ "lib/bixby/provision/dsl/nodejs.rb",
38
+ "lib/bixby/provision/dsl/npm.rb",
39
+ "lib/bixby/provision/dsl/ntp.rb",
40
+ "lib/bixby/provision/dsl/packager/apt.rb",
41
+ "lib/bixby/provision/dsl/packager/base.rb",
42
+ "lib/bixby/provision/dsl/packager/npm.rb",
43
+ "lib/bixby/provision/dsl/packager/yum.rb",
44
+ "lib/bixby/provision/dsl/packager/yum/epel.rb",
45
+ "lib/bixby/provision/dsl/packager/yum/mongodb.rb",
46
+ "lib/bixby/provision/dsl/ruby.rb",
47
+ "lib/bixby/provision/dsl/run_control.rb",
48
+ "lib/bixby/provision/dsl/scm.rb",
49
+ "lib/bixby/provision/dsl/scm/base.rb",
50
+ "lib/bixby/provision/dsl/scm/git.rb",
51
+ "lib/bixby/provision/dsl/scm/svn.rb",
52
+ "lib/bixby/provision/dsl/service.rb",
53
+ "lib/bixby/provision/dsl/services/base.rb",
54
+ "lib/bixby/provision/dsl/services/init.rb",
55
+ "lib/bixby/provision/dsl/system.rb",
56
+ "lib/bixby/provision/dsl/util/file.rb",
57
+ "lib/bixby/provision/dsl/variable.rb",
58
+ "lib/bixby/provision/manifest.rb",
59
+ "lib/bixby/provision/manifest/dsl_proxy.rb",
60
+ "manifest.rb",
61
+ "tasks/coverage.rake",
62
+ "tasks/jeweler.rake",
63
+ "tasks/test.rake",
64
+ "tasks/yard.rake"
65
+ ]
66
+ s.homepage = "http://github.com/chetan/bixby-provision"
67
+ s.licenses = ["MIT"]
68
+ s.rubygems_version = "2.2.2"
69
+ s.summary = "Bixby Provision"
70
+
71
+ if s.respond_to? :specification_version then
72
+ s.specification_version = 4
73
+
74
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
75
+ s.add_runtime_dependency(%q<bixby-client>, [">= 0"])
76
+ s.add_runtime_dependency(%q<api-auth>, [">= 0"])
77
+ s.add_runtime_dependency(%q<mixlib-shellout>, ["~> 1.3.0"])
78
+ s.add_runtime_dependency(%q<git>, ["~> 1.2.6"])
79
+ s.add_runtime_dependency(%q<tilt>, ["~> 2.0"])
80
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
81
+ s.add_development_dependency(%q<yard>, ["~> 0.7"])
82
+ s.add_development_dependency(%q<pry>, [">= 0"])
83
+ s.add_development_dependency(%q<awesome_print>, [">= 0"])
84
+ s.add_development_dependency(%q<test_guard>, [">= 0"])
85
+ s.add_development_dependency(%q<micron>, [">= 0"])
86
+ else
87
+ s.add_dependency(%q<bixby-client>, [">= 0"])
88
+ s.add_dependency(%q<api-auth>, [">= 0"])
89
+ s.add_dependency(%q<mixlib-shellout>, ["~> 1.3.0"])
90
+ s.add_dependency(%q<git>, ["~> 1.2.6"])
91
+ s.add_dependency(%q<tilt>, ["~> 2.0"])
92
+ s.add_dependency(%q<jeweler>, [">= 0"])
93
+ s.add_dependency(%q<yard>, ["~> 0.7"])
94
+ s.add_dependency(%q<pry>, [">= 0"])
95
+ s.add_dependency(%q<awesome_print>, [">= 0"])
96
+ s.add_dependency(%q<test_guard>, [">= 0"])
97
+ s.add_dependency(%q<micron>, [">= 0"])
98
+ end
99
+ else
100
+ s.add_dependency(%q<bixby-client>, [">= 0"])
101
+ s.add_dependency(%q<api-auth>, [">= 0"])
102
+ s.add_dependency(%q<mixlib-shellout>, ["~> 1.3.0"])
103
+ s.add_dependency(%q<git>, ["~> 1.2.6"])
104
+ s.add_dependency(%q<tilt>, ["~> 2.0"])
105
+ s.add_dependency(%q<jeweler>, [">= 0"])
106
+ s.add_dependency(%q<yard>, ["~> 0.7"])
107
+ s.add_dependency(%q<pry>, [">= 0"])
108
+ s.add_dependency(%q<awesome_print>, [">= 0"])
109
+ s.add_dependency(%q<test_guard>, [">= 0"])
110
+ s.add_dependency(%q<micron>, [">= 0"])
111
+ end
112
+ end
113
+
@@ -0,0 +1,2 @@
1
+
2
+ require "bixby/provision"
@@ -0,0 +1,65 @@
1
+
2
+ require "bixby-common"
3
+ require "bixby-client"
4
+
5
+ module Bixby
6
+ module Provision
7
+
8
+ def self.register_dsl(obj, name=nil)
9
+
10
+ # create a simple name if none given
11
+ # "Bixby::Provision::Config" > :config
12
+ if name.nil? then
13
+ name = obj.name.split(/::/).last.downcase
14
+ end
15
+ name = name.to_sym
16
+
17
+ # return the dsl object via its name
18
+ # always returns the same instance
19
+ Manifest::DSLProxy.class_eval <<-EOF
20
+ def #{name}
21
+ return @#{name} if @#{name} # return already created instance
22
+
23
+ @#{name} = #{obj.name}.new
24
+ @#{name}.manifest = self.manifest
25
+ @#{name}.proxy = self
26
+ @#{name}
27
+ end
28
+ EOF
29
+
30
+ if obj.const_defined? :EXPORTS then
31
+ obj::EXPORTS.each do |e|
32
+
33
+ Manifest::DSLProxy.class_eval do
34
+ def_delegator name, e.to_sym
35
+ end
36
+
37
+ end
38
+ end
39
+
40
+ # add accessors for each DSL object
41
+ Base.class_eval <<-EOF
42
+ def #{name}
43
+ self.proxy.send(:#{name})
44
+ end
45
+ EOF
46
+
47
+ end
48
+
49
+ end
50
+ end
51
+
52
+ require "bixby/provision/manifest"
53
+ require "bixby/provision/dsl"
54
+
55
+ Bixby::Log.setup_logger(:filename => Bixby.path("var", "provision.log"))
56
+
57
+ # enable condensed logging to stdout
58
+ Logging.appenders.stdout( 'provision_stdout',
59
+ :auto_flushing => true,
60
+ :layout => Logging.layouts.pattern(
61
+ :pattern => '%.1l, [%d] %m\n',
62
+ :color_scheme => 'bright'
63
+ )
64
+ )
65
+ Logging::Logger.root.add_appenders("provision_stdout")