Class: Dply::Strategy::Git

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Helper
Defined in:
lib/dply/strategy/git.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#cmd, #error, #git, #logger, #sh, #symlink

Constructor Details

#initialize(config, options) ⇒ Git

Returns a new instance of Git.



18
19
20
21
# File 'lib/dply/strategy/git.rb', line 18

def initialize(config, options)
  @config = config
  @options = options || {}
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



14
15
16
# File 'lib/dply/strategy/git.rb', line 14

def config
  @config
end

#optionsObject (readonly)

Returns the value of attribute options.



14
15
16
# File 'lib/dply/strategy/git.rb', line 14

def options
  @options
end

Instance Method Details

#deployObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/dply/strategy/git.rb', line 23

def deploy
  deploy_target = (target || :git)
  setup.git
  generate_meta_config
  Dir.chdir current_dir do
    previous_version = git.commit_id
    git_step
    current_version = git.commit_id
    link_all
    install_pkgs
    bundle.install(without: config.bundler_without)
    bundle.clean
    util.run "deploy:#{deploy_target}", render_config: true
    util.report_changes(previous_version, current_version)
  end
end

#reloadObject



40
41
42
43
44
45
46
# File 'lib/dply/strategy/git.rb', line 40

def reload
  generate_meta_config
  Dir.chdir current_dir do
    link_all
    util.run :reload, render_config: true
  end
end