Sha256: 836067bc3c638b538b9852f64e8e75b73f67eefb94ad31cf91e7499d3fed58bc

Contents?: true

Size: 1.37 KB

Versions: 9

Compression:

Stored size: 1.37 KB

Contents

module Vx
  module Builder
    class ScriptBuilder

      Base = Struct.new(:app) do

        include Helper::TraceShCommand
        include Common::Helper::UploadShCommand
        include Helper::VxvmInstall

        def do_cache_key(env)
          yield env.cache_key
        end

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

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

        def do_init(env)
          yield env.init
        end

        def do_announce(env)
          yield env.announce
        end

        def do_before_install(env)
          yield env.before_install
        end

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

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

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

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

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

      end

    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vx-builder-0.5.24 lib/vx/builder/script_builder/base.rb
vx-builder-0.5.23 lib/vx/builder/script_builder/base.rb
vx-builder-0.5.22 lib/vx/builder/script_builder/base.rb
vx-builder-0.5.21 lib/vx/builder/script_builder/base.rb
vx-builder-0.5.20 lib/vx/builder/script_builder/base.rb
vx-builder-0.5.19 lib/vx/builder/script_builder/base.rb
vx-builder-0.5.18 lib/vx/builder/script_builder/base.rb
vx-builder-0.5.17 lib/vx/builder/script_builder/base.rb
vx-builder-0.5.16 lib/vx/builder/script_builder/base.rb