Class: Dply::Strategy::Archive
- Inherits:
-
Object
- Object
- Dply::Strategy::Archive
- Extended by:
- Forwardable
- Includes:
- Helper
- Defined in:
- lib/dply/strategy/archive.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) ⇒ Archive
constructor
A new instance of Archive.
- #reload ⇒ Object
Methods included from Helper
#cmd, #error, #git, #logger, #sh, #symlink
Constructor Details
#initialize(config, options) ⇒ Archive
Returns a new instance of Archive.
20 21 22 23 |
# File 'lib/dply/strategy/archive.rb', line 20 def initialize(config, ) @config = config = || {} end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
16 17 18 |
# File 'lib/dply/strategy/archive.rb', line 16 def config @config end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
16 17 18 |
# File 'lib/dply/strategy/archive.rb', line 16 def end |
Instance Method Details
#deploy ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/dply/strategy/archive.rb', line 25 def deploy error "revision not specified( use -r)" if not revision setup.archive if release.already_deployed? && release.current? logger.info "revision #{revision} is currently deployed" current_version = previous_version = get_release prune_releases util.report_changes(current_version, previous_version) return end install_release previous_version = get_release release.make_current Dir.chdir current_dir do util.run "deploy:#{deploy_target}", render_config: true end release.record_deployment current_version = get_release prune_releases util.report_changes(previous_version, current_version) end |
#reload ⇒ Object
48 49 50 51 52 53 54 |
# File 'lib/dply/strategy/archive.rb', line 48 def reload Dir.chdir current_dir do link_all util.run :reload, render_config: true end end |