Class: Vx::Builder::ScriptBuilder::Base

Inherits:
Struct
  • Object
show all
Includes:
Common::Helper::UploadShCommand, Helper::TraceShCommand, Helper::VxvmInstall
Defined in:
lib/vx/builder/script_builder/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper::VxvmInstall

#vxvm_install

Methods included from Helper::TraceShCommand

#trace_sh_command

Instance Attribute Details

#appObject

Returns the value of attribute app

Returns:

  • (Object)

    the current value of app



5
6
7
# File 'lib/vx/builder/script_builder/base.rb', line 5

def app
  @app
end

Instance Method Details

#deploy?(env) ⇒ Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/vx/builder/script_builder/base.rb', line 69

def deploy?(env)
  env.source.deploy_modules?
end

#do_after_deploy(env) ⇒ Object



63
64
65
66
67
# File 'lib/vx/builder/script_builder/base.rb', line 63

def do_after_deploy(env)
  if deploy?(env)
    yield env.after_success
  end
end

#do_announce(env) {|env.announce| ... } ⇒ Object

Yields:

  • (env.announce)


31
32
33
# File 'lib/vx/builder/script_builder/base.rb', line 31

def do_announce(env)
  yield env.announce
end

#do_before_deploy(env) ⇒ Object



57
58
59
60
61
# File 'lib/vx/builder/script_builder/base.rb', line 57

def do_before_deploy(env)
  if deploy?(env)
    yield env.before_script
  end
end

#do_before_install(env) {|env.before_install| ... } ⇒ Object

Yields:

  • (env.before_install)


35
36
37
# File 'lib/vx/builder/script_builder/base.rb', line 35

def do_before_install(env)
  yield env.before_install
end

#do_before_script(env) ⇒ Object



45
46
47
48
49
# File 'lib/vx/builder/script_builder/base.rb', line 45

def do_before_script(env)
  if env.source.before_script.empty? && !deploy?(env)
    yield env.before_script
  end
end

#do_cache_key(env) {|env.cache_key| ... } ⇒ Object

Yields:

  • (env.cache_key)


11
12
13
# File 'lib/vx/builder/script_builder/base.rb', line 11

def do_cache_key(env)
  yield env.cache_key
end

#do_cached_directories(env) ⇒ Object



21
22
23
24
25
# File 'lib/vx/builder/script_builder/base.rb', line 21

def do_cached_directories(env)
  if env.source.cached_directories != false
    yield env.cached_directories
  end
end

#do_deploy_script(env) ⇒ Object



51
52
53
54
55
# File 'lib/vx/builder/script_builder/base.rb', line 51

def do_deploy_script(env)
  if deploy?(env)
    yield env.script
  end
end

#do_init(env) {|env.init| ... } ⇒ Object

Yields:

  • (env.init)


27
28
29
# File 'lib/vx/builder/script_builder/base.rb', line 27

def do_init(env)
  yield env.init
end

#do_install(env) ⇒ Object



39
40
41
42
43
# File 'lib/vx/builder/script_builder/base.rb', line 39

def do_install(env)
  if env.source.install.empty?
    yield env.install
  end
end

#do_script(env) ⇒ Object



15
16
17
18
19
# File 'lib/vx/builder/script_builder/base.rb', line 15

def do_script(env)
  if env.source.script.empty? && !env.source.deploy_modules?
    yield env.script
  end
end