Class: Dply::Strategy::Git
- Inherits:
-
Object
- Object
- Dply::Strategy::Git
- Extended by:
- Forwardable
- Includes:
- Helper
- Defined in:
- lib/dply/strategy/git.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #deploy ⇒ Object
-
#initialize(config, options) ⇒ Git
constructor
A new instance of Git.
- #reload ⇒ Object
Methods included from Helper
#cmd, #error, #git, #logger, #sh, #symlink
Constructor Details
#initialize(config, options) ⇒ Git
Returns a new instance of Git.
20 21 22 23 |
# File 'lib/dply/strategy/git.rb', line 20 def initialize(config, ) @config = config @options = || {} end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
15 16 17 |
# File 'lib/dply/strategy/git.rb', line 15 def config @config end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
15 16 17 |
# File 'lib/dply/strategy/git.rb', line 15 def @options end |
Instance Method Details
#deploy ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/dply/strategy/git.rb', line 25 def deploy deploy_target = (target || :git) setup.git download_configs if config_download_url Dir.chdir current_dir do previous_version = git.commit_id git_step current_version = git.commit_id link_all install_pkgs bundle.install bundle.clean util.run "deploy:#{deploy_target}" util.report_changes(previous_version, current_version) end end |
#reload ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/dply/strategy/git.rb', line 42 def reload download_configs if config_download_url Dir.chdir current_dir do link_all util.run :reload end end |