rocket_fuel 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rocket_fuel/command_line_interface.rb +8 -2
- data/lib/rocket_fuel/install.rb +8 -0
- data/lib/rocket_fuel/install/chef_install.rb +10 -0
- data/lib/rocket_fuel/install/download.rb +37 -0
- data/lib/rocket_fuel/install/recipe_run.rb +10 -0
- data/lib/rocket_fuel/install/run.rb +30 -0
- data/lib/rocket_fuel/precheck/run.rb +8 -4
- data/lib/rocket_fuel/version.rb +1 -1
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9908a5c1ceba99833e61048a297295df291389be
|
4
|
+
data.tar.gz: 0bd720d0d68cd8fd2ccc07081176c77608ae7156
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4c75b96ce3c7e2bf8e7ec7bac8ce2b91b74c61188088bdf7684e222ec58fded88c7c37498a3e1249df32f7f3234b4cf5e9a578245bb4057fe4acb035fdf3ce8f
|
7
|
+
data.tar.gz: f20046fba9c7aa8d905652b33fba2c9b878e035b089e47428ee511da590417bcdc5180db41aa5104faa6d460673c010a102188fdb227dada37b1427a806d8c37
|
@@ -8,8 +8,9 @@ module RocketFuel
|
|
8
8
|
say '***Rocket Fuel: Checking prerequisites***', :blue
|
9
9
|
say ''
|
10
10
|
|
11
|
-
RocketFuel::Precheck::Run.new.
|
12
|
-
|
11
|
+
RocketFuel::Precheck::Run.new.tap do |run|
|
12
|
+
run.results
|
13
|
+
end
|
13
14
|
end
|
14
15
|
|
15
16
|
desc 'fix', 'fix problems that can cause issues with running rocket fuel'
|
@@ -35,6 +36,11 @@ module RocketFuel
|
|
35
36
|
|
36
37
|
desc 'install [package]', 'install rocket fuel packages'
|
37
38
|
def install
|
39
|
+
require 'rocket_fuel/install'
|
40
|
+
run = precheck
|
41
|
+
if run.ok?
|
42
|
+
RocketFuel::Install::Run.new.run
|
43
|
+
end
|
38
44
|
end
|
39
45
|
end
|
40
46
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'net/http'
|
2
|
+
require 'open-uri'
|
3
|
+
require 'fileutils'
|
4
|
+
|
5
|
+
module RocketFuel
|
6
|
+
module Install
|
7
|
+
class Download
|
8
|
+
URL = 'https://codeload.github.com/LaunchAcademy/rocket-fuel-chef/tar.gz/master'
|
9
|
+
|
10
|
+
def retrieve
|
11
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
12
|
+
http.use_ssl = true
|
13
|
+
resp = http.get(uri.request_uri)
|
14
|
+
open(archive_path, "wb") do |file|
|
15
|
+
file.write(resp.body)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def extract
|
20
|
+
`tar xvfz #{archive_path} -C #{File.join(recipe_path, '..') }`
|
21
|
+
end
|
22
|
+
|
23
|
+
protected
|
24
|
+
def archive_path
|
25
|
+
RocketFuel::Install::ARCHIVE_PATH
|
26
|
+
end
|
27
|
+
|
28
|
+
def recipe_path
|
29
|
+
RocketFuel::Install::RECIPE_PATH
|
30
|
+
end
|
31
|
+
|
32
|
+
def uri
|
33
|
+
@uri = URI.parse(URL)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'rocket_fuel/install/download'
|
2
|
+
require 'rocket_fuel/install/chef_install'
|
3
|
+
require 'rocket_fuel/install/recipe_run'
|
4
|
+
|
5
|
+
module RocketFuel
|
6
|
+
module Install
|
7
|
+
class Run
|
8
|
+
include Thor::Base
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
@download = RocketFuel::Install::Download.new
|
12
|
+
end
|
13
|
+
|
14
|
+
def run
|
15
|
+
say('Downloading rocket fuel recipes...')
|
16
|
+
@download.retrieve
|
17
|
+
say('Done.')
|
18
|
+
say('Extracting rocket fuel recipes...')
|
19
|
+
@download.extract
|
20
|
+
say('Done.')
|
21
|
+
say('Installing chef omnibus. You may be prompted for your sudo password..')
|
22
|
+
RocketFuel::Install::ChefInstall.new.run
|
23
|
+
say('Done.')
|
24
|
+
say('Running rocket fuel recipes...this may take some time')
|
25
|
+
RocketFuel::Install::RecipeRun.new.run
|
26
|
+
say('Done')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -13,14 +13,18 @@ module RocketFuel
|
|
13
13
|
module Precheck
|
14
14
|
class Run
|
15
15
|
include Thor::Base
|
16
|
+
def ok?
|
17
|
+
!@failed_checks.nil? && @failed_checks.empty?
|
18
|
+
end
|
19
|
+
|
16
20
|
def results
|
17
|
-
failed_checks = []
|
21
|
+
@failed_checks = []
|
18
22
|
RocketFuel::Precheck.checks.each do |key, klass|
|
19
23
|
check = klass.new
|
20
24
|
if check.check?
|
21
25
|
CommandLineResultPresenter.new(check).present
|
22
26
|
if !check.ok?
|
23
|
-
failed_checks << key
|
27
|
+
@failed_checks << key
|
24
28
|
end
|
25
29
|
end
|
26
30
|
end
|
@@ -29,11 +33,11 @@ module RocketFuel
|
|
29
33
|
say('========================')
|
30
34
|
say('')
|
31
35
|
|
32
|
-
if
|
36
|
+
if !@failed_checks.empty?
|
33
37
|
say('***YOU ARE NOT CLEARED FOR INSTALLATION***', :red)
|
34
38
|
say('')
|
35
39
|
|
36
|
-
failed_checks.each do |sym|
|
40
|
+
@failed_checks.each do |sym|
|
37
41
|
if RocketFuel::Precheck.fixes[sym]
|
38
42
|
fix = RocketFuel::Precheck.fixes[sym].new
|
39
43
|
say("#{fix.title}", :red)
|
data/lib/rocket_fuel/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocket_fuel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Pickett
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -124,6 +124,11 @@ files:
|
|
124
124
|
- lib/rocket_fuel/fix/macports_fix.rb
|
125
125
|
- lib/rocket_fuel/fix/rbenv_fix.rb
|
126
126
|
- lib/rocket_fuel/fix/rvm_fix.rb
|
127
|
+
- lib/rocket_fuel/install.rb
|
128
|
+
- lib/rocket_fuel/install/chef_install.rb
|
129
|
+
- lib/rocket_fuel/install/download.rb
|
130
|
+
- lib/rocket_fuel/install/recipe_run.rb
|
131
|
+
- lib/rocket_fuel/install/run.rb
|
127
132
|
- lib/rocket_fuel/operating_system.rb
|
128
133
|
- lib/rocket_fuel/precheck.rb
|
129
134
|
- lib/rocket_fuel/precheck/check.rb
|