Class: Perkins::Build::Script
- Defined in:
- lib/perkins/build/script.rb,
lib/perkins/build/script/go.rb,
lib/perkins/build/script/jdk.rb,
lib/perkins/build/script/rvm.rb,
lib/perkins/build/script/ruby.rb,
lib/perkins/build/script/stages.rb,
lib/perkins/build/script/bundler.rb,
lib/perkins/build/script/helpers.rb
Defined Under Namespace
Modules: Bundler, Helpers, Jdk, RVM, Stages Classes: Go, Ruby
Constant Summary collapse
- TEMPLATES_PATH =
File.('../script/templates', __FILE__)
- STAGES =
{ builtin: [:configure, :checkout, :pre_setup, :export, :setup, :announce], custom: [:before_install, :install, :before_script, :script, :after_result, :after_script] }
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#stack ⇒ Object
readonly
Returns the value of attribute stack.
Class Method Summary collapse
Instance Method Summary collapse
-
#compile ⇒ Object
run stages.
-
#initialize(data, repo) ⇒ Script
constructor
A new instance of Script.
Methods included from Helpers
#announce?, #before_install, #failure, #sh, #stacking
Methods included from Stages
#call_custom_stage, #run_builtin_stage, #run_stage, #run_stages
Constructor Details
#initialize(data, repo) ⇒ Script
Returns a new instance of Script.
63 64 65 66 67 68 69 70 |
# File 'lib/perkins/build/script.rb', line 63 def initialize(data, repo) @config = data #used in runner @repo = repo #@stack = [] @data = Data.new({ config: self.class.defaults }.deep_merge(data.deep_symbolize_keys)) @options = @stack = [Shell::Script.new(echo: true, timing: true)] end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
52 53 54 |
# File 'lib/perkins/build/script.rb', line 52 def data @data end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
52 53 54 |
# File 'lib/perkins/build/script.rb', line 52 def @options end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
51 52 53 |
# File 'lib/perkins/build/script.rb', line 51 def repo @repo end |
#stack ⇒ Object (readonly)
Returns the value of attribute stack.
51 52 53 |
# File 'lib/perkins/build/script.rb', line 51 def stack @stack end |
Class Method Details
.defaults ⇒ Object
55 56 57 |
# File 'lib/perkins/build/script.rb', line 55 def defaults self::DEFAULTS end |
Instance Method Details
#compile ⇒ Object
run stages
73 74 75 76 77 78 79 80 |
# File 'lib/perkins/build/script.rb', line 73 def compile #run_stages if check_config #@stack.compact.join(" && ") raw template 'header.sh' run_stages.compact if check_config raw template 'footer.sh' sh.to_s end |