Class: Phase::Deploy::Build

Inherits:
Object
  • Object
show all
Includes:
Util::Shell
Defined in:
lib/phase/kit/deploy/build.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Util::Shell

#shell

Methods included from Util::Console

#ask, #fail, #log

Constructor Details

#initialize(version_tag, options = {}) ⇒ Build

Returns a new instance of Build.



9
10
11
12
13
14
15
16
17
18
# File 'lib/phase/kit/deploy/build.rb', line 9

def initialize(version_tag, options = {})
  @clean_build = options.fetch(:clean_build, true)
  @version_tag = version_tag

  if clean_build
    @build_dir = ::Pathname.new( options.fetch(:build_dir, "build") )
  else
    @build_dir = ::Pathname.new(".")
  end
end

Instance Attribute Details

#build_dirObject (readonly)

Returns the value of attribute build_dir.



7
8
9
# File 'lib/phase/kit/deploy/build.rb', line 7

def build_dir
  @build_dir
end

#clean_buildObject (readonly)

Returns the value of attribute clean_build.



7
8
9
# File 'lib/phase/kit/deploy/build.rb', line 7

def clean_build
  @clean_build
end

#version_tagObject (readonly)

Returns the value of attribute version_tag.



7
8
9
# File 'lib/phase/kit/deploy/build.rb', line 7

def version_tag
  @version_tag
end

Instance Method Details

#execute!Object



20
21
22
23
24
25
26
# File 'lib/phase/kit/deploy/build.rb', line 20

def execute!
  prepare_environment
  build_assets
  commit_new_version!
  build_image
  push
end