binfuse 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +6 -0
- data/bin/binfuse +128 -0
- data/binfuse.rdoc +5 -0
- data/lib/binfuse.rb +15 -0
- data/lib/binfuse/version.rb +3 -0
- metadata +154 -0
data/README.rdoc
ADDED
data/bin/binfuse
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'gli'
|
3
|
+
require 'paint'
|
4
|
+
require 'progress_bar'
|
5
|
+
|
6
|
+
begin # XXX: Remove this begin/rescue before distributing your app
|
7
|
+
require 'binfuse'
|
8
|
+
rescue LoadError
|
9
|
+
STDERR.puts "In development, you need to use `bundle exec bin/binfuse` to run your app"
|
10
|
+
STDERR.puts "At install-time, RubyGems will make sure lib, etc. are in the load path"
|
11
|
+
STDERR.puts "Feel free to remove this message from bin/binfuse now"
|
12
|
+
exit 64
|
13
|
+
end
|
14
|
+
|
15
|
+
include GLI::App
|
16
|
+
|
17
|
+
program_desc 'Describe your application here'
|
18
|
+
|
19
|
+
version Binfuse::VERSION
|
20
|
+
|
21
|
+
desc 'Describe some switch here'
|
22
|
+
switch [:s,:switch]
|
23
|
+
|
24
|
+
desc 'Describe some flag here'
|
25
|
+
default_value 'the default'
|
26
|
+
arg_name 'The name of the argument'
|
27
|
+
flag [:f,:flagname]
|
28
|
+
|
29
|
+
desc 'Describe create here'
|
30
|
+
arg_name 'Describe arguments to create here'
|
31
|
+
command :create do |c|
|
32
|
+
c.desc 'use base image IMAGE'
|
33
|
+
c.default_value 'Ubuntu x64'
|
34
|
+
c.flag [:m,'base-image']
|
35
|
+
|
36
|
+
c.desc 'use build file FILE'
|
37
|
+
c.default_value 'Buildfile'
|
38
|
+
c.flag [:b,'build-file']
|
39
|
+
|
40
|
+
c.desc 'Describe a switch to create'
|
41
|
+
c.switch :s
|
42
|
+
|
43
|
+
c.desc 'Describe a flag to create'
|
44
|
+
c.default_value 'default'
|
45
|
+
c.flag :f
|
46
|
+
c.action do |global_options,options,args|
|
47
|
+
|
48
|
+
# Your command logic here
|
49
|
+
puts Console::INFO + 'Downloading Base Image ' + Paint[ options[:m], :bold]
|
50
|
+
|
51
|
+
bar = ProgressBar.new(100, :bar, :elapsed, :eta)
|
52
|
+
100.times do
|
53
|
+
sleep 0.06
|
54
|
+
bar.increment! 1
|
55
|
+
end
|
56
|
+
puts Console::INFO + 'Download Complete'
|
57
|
+
|
58
|
+
puts Console::INFO + 'Loading Build File: ' + Paint[ options[:b], :bold]
|
59
|
+
puts Console::INFO + 'Building Image'
|
60
|
+
puts Console::Indent(1) + Paint['Installing Package "Nginx"', :white]; sleep 1
|
61
|
+
puts Console::Indent(1) + Paint['Installing Package "Node.js"', :white]; sleep 1
|
62
|
+
puts Console::Indent(1) + Paint['Installing Service Container', :white]; sleep 1
|
63
|
+
puts Console::Indent(1) + Paint['Installing Application', :white]; sleep 1
|
64
|
+
|
65
|
+
puts Console::INFO + 'Running Tests ...'
|
66
|
+
puts Console::Indent(1) + Paint['Testing Application Failover', :white] + Paint[" \u2714 Okay", :green]; sleep 1
|
67
|
+
puts Console::Indent(1) + Paint['Testing System Startup', :white] + Paint[" \u2714 Okay", :green]; sleep 1
|
68
|
+
puts Console::Indent(1) + Paint['Testing Crash Recovery', :white] + Paint[" \u2714 Okay", :green]; sleep 1
|
69
|
+
|
70
|
+
puts Console::INFO + 'Saving Image'
|
71
|
+
|
72
|
+
# If you have any errors, just raise them
|
73
|
+
# raise "that command made no sense"
|
74
|
+
|
75
|
+
puts Console::DONE + 'Image Creation Done!'
|
76
|
+
puts Console::INFO + 'Use ' + \
|
77
|
+
Paint['binfuse spawn myapp@38ddf2', :white] + \
|
78
|
+
' to attach and run this image'
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
desc 'Describe test here'
|
84
|
+
arg_name 'Describe arguments to test here'
|
85
|
+
command :test do |c|
|
86
|
+
c.action do |global_options,options,args|
|
87
|
+
puts "test command ran"
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
desc 'Describe spawn here'
|
92
|
+
arg_name 'Describe arguments to spawn here'
|
93
|
+
command :spawn do |c|
|
94
|
+
c.action do |global_options,options,args|
|
95
|
+
puts "spawn command ran"
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
desc 'Describe publish here'
|
100
|
+
arg_name 'Describe arguments to publish here'
|
101
|
+
command :publish do |c|
|
102
|
+
c.action do |global_options,options,args|
|
103
|
+
puts "publish command ran"
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
pre do |global,command,options,args|
|
108
|
+
# Pre logic here
|
109
|
+
# Return true to proceed; false to abort and not call the
|
110
|
+
# chosen command
|
111
|
+
# Use skips_pre before a command to skip this block
|
112
|
+
# on that command only
|
113
|
+
true
|
114
|
+
end
|
115
|
+
|
116
|
+
post do |global,command,options,args|
|
117
|
+
# Post logic here
|
118
|
+
# Use skips_post before a command to skip this
|
119
|
+
# block on that command only
|
120
|
+
end
|
121
|
+
|
122
|
+
on_error do |exception|
|
123
|
+
# Error logic here
|
124
|
+
# return false to skip default error handling
|
125
|
+
true
|
126
|
+
end
|
127
|
+
|
128
|
+
exit run(ARGV)
|
data/binfuse.rdoc
ADDED
data/lib/binfuse.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'binfuse/version.rb'
|
2
|
+
|
3
|
+
# Add requires for other files you add to your project here, so
|
4
|
+
# you just need to require this one file in your bin file
|
5
|
+
|
6
|
+
module Console
|
7
|
+
|
8
|
+
INFO = Paint['[Info] ',:green]
|
9
|
+
DONE = Paint['[Done] ',:blue]
|
10
|
+
|
11
|
+
def self.Indent(value)
|
12
|
+
return " "
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,154 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: binfuse
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Your Name Here
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-01-07 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rdoc
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: aruba
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: gli
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - '='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 2.5.3
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - '='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 2.5.3
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: paint
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - '='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 0.8.5
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - '='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 0.8.5
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: progress_bar
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - '='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: 0.4.0
|
102
|
+
type: :runtime
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - '='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.4.0
|
110
|
+
description:
|
111
|
+
email: your@email.address.com
|
112
|
+
executables:
|
113
|
+
- binfuse
|
114
|
+
extensions: []
|
115
|
+
extra_rdoc_files:
|
116
|
+
- README.rdoc
|
117
|
+
- binfuse.rdoc
|
118
|
+
files:
|
119
|
+
- bin/binfuse
|
120
|
+
- lib/binfuse/version.rb
|
121
|
+
- lib/binfuse.rb
|
122
|
+
- README.rdoc
|
123
|
+
- binfuse.rdoc
|
124
|
+
homepage: http://your.website.com
|
125
|
+
licenses: []
|
126
|
+
post_install_message:
|
127
|
+
rdoc_options:
|
128
|
+
- --title
|
129
|
+
- binfuse
|
130
|
+
- --main
|
131
|
+
- README.rdoc
|
132
|
+
- -ri
|
133
|
+
require_paths:
|
134
|
+
- lib
|
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
|
+
rubyforge_project:
|
150
|
+
rubygems_version: 1.8.24
|
151
|
+
signing_key:
|
152
|
+
specification_version: 3
|
153
|
+
summary: A description of your project
|
154
|
+
test_files: []
|