Module: Mimas::Deployment::StaticSite

Included in:
Mimas::Deployment
Defined in:
lib/mimas/deployment/static_site.rb

Instance Method Summary collapse

Instance Method Details

#deploy_static_siteObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/mimas/deployment/static_site.rb', line 4

def deploy_static_site
  say "Starting deployment for #{site.domain}"

  @archive_path = site.archive(filename: archive_name)

  ssh(server) do |session|
    refreshing_caddy(session) do
      say "Uploading version: #{version}"
      session.upload archive_path, "#{remote_destination}/"

      say "Extracting version: #{version}"
      session.run "cd #{remote_destination} && tar -xf #{archive_name} && rm #{archive_name}"

      say "Updating current symlink"
      session.run "ln -sfn #{remote_destination} #{current_path}"
      say "Current symlink updated"
    end
  end

  say "\n\n"
  say "Deployment complete! #{version} is now live.".bold.white
end