Class: Afterlife::Deploy::CdnDeployment

Inherits:
Deployment
  • Object
show all
Defined in:
lib/afterlife/deploy/cdn_deployment.rb

Direct Known Subclasses

CdnStenciljsDeployment

Instance Attribute Summary

Attributes inherited from Deployment

#options

Instance Method Summary collapse

Methods inherited from Deployment

#initialize, #repo_command

Constructor Details

This class inherits a constructor from Afterlife::Deploy::Deployment

Instance Method Details

#confirmation_messageObject



28
29
30
31
# File 'lib/afterlife/deploy/cdn_deployment.rb', line 28

def confirmation_message
  repo.confirmation_message ||
    "You are about to deploy the contents of '#{repo.dist_path}' to"
end

#initial_messageObject



24
25
26
# File 'lib/afterlife/deploy/cdn_deployment.rb', line 24

def initial_message
  repo.dist_path
end

#outputObject



10
11
12
# File 'lib/afterlife/deploy/cdn_deployment.rb', line 10

def output
  Cdn.url(repo)
end

#runObject



6
7
8
# File 'lib/afterlife/deploy/cdn_deployment.rb', line 6

def run
  Exec.run(commands)
end

#setupObject



14
15
16
17
18
19
20
21
22
# File 'lib/afterlife/deploy/cdn_deployment.rb', line 14

def setup
  # only use the defined AWS_PROFILE if its not already been defined
  repo.env.set(
    'AWS_BUCKET' => Afterlife.current_stage.bucket,
    'AWS_REGION' => Afterlife.current_stage.region,
  )
  # in nested deployments we need the current path, not the parent's
  repo.env.set!('S3_FULL_PATH' => s3_full_path)
end