Class: Mimas::Deployment
- Inherits:
-
Object
- Object
- Mimas::Deployment
- Includes:
- Caddy, Files, Paths, RubyApp, StaticSite, SSH, Template, Terminal::Printer
- Defined in:
- lib/mimas/deployment.rb,
lib/mimas/deployment/caddy.rb,
lib/mimas/deployment/files.rb,
lib/mimas/deployment/paths.rb,
lib/mimas/deployment/ruby_app.rb,
lib/mimas/deployment/static_site.rb
Defined Under Namespace
Modules: Caddy, Files, Paths, RubyApp, StaticSite
Constant Summary
Constants included from Files
Constants included from Template
Instance Attribute Summary collapse
-
#commit_hash ⇒ Object
readonly
Returns the value of attribute commit_hash.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#site ⇒ Object
readonly
Returns the value of attribute site.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #deploy ⇒ Object
-
#initialize(site:, server:) ⇒ Deployment
constructor
A new instance of Deployment.
Methods included from StaticSite
Methods included from RubyApp
Methods included from Caddy
Methods included from Paths
#archive_name, #archive_path, #caddyfile_path, #current_path, #deploy_script_path, #mimas_path, #new_caddyfile_path, #releases_path, #remote_destination, #ruby_version, #site_root, #unix_socket
Methods included from Files
#caddyfile, #deploy_script, #mimas_env, #systemd, #systemd_service_name
Methods included from Terminal::Printer
Methods included from Template
#copy_file, lookup_paths, #read_file, #template
Methods included from SSH
Constructor Details
#initialize(site:, server:) ⇒ Deployment
Returns a new instance of Deployment.
10 11 12 13 14 15 |
# File 'lib/mimas/deployment.rb', line 10 def initialize(site:, server:) @site = site @server = server @version = Time.now.utc.strftime("%Y%m%d%H%M%S") @commit_hash = `git rev-parse HEAD` end |
Instance Attribute Details
#commit_hash ⇒ Object (readonly)
Returns the value of attribute commit_hash.
8 9 10 |
# File 'lib/mimas/deployment.rb', line 8 def commit_hash @commit_hash end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
8 9 10 |
# File 'lib/mimas/deployment.rb', line 8 def server @server end |
#site ⇒ Object (readonly)
Returns the value of attribute site.
8 9 10 |
# File 'lib/mimas/deployment.rb', line 8 def site @site end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
8 9 10 |
# File 'lib/mimas/deployment.rb', line 8 def version @version end |
Instance Method Details
#deploy ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/mimas/deployment.rb', line 17 def deploy if site.static? deploy_static_site else deploy_ruby_app end ensure File.delete(archive_path) end |