Module: Afterlife::Deploy
- Defined in:
- lib/afterlife/deploy.rb,
lib/afterlife/deploy/cli.rb,
lib/afterlife/deploy/deployment.rb,
lib/afterlife/deploy/cdn_deployment.rb,
lib/afterlife/deploy/custom_deployment.rb,
lib/afterlife/deploy/kubernetes_deployment.rb,
lib/afterlife/deploy/cdn_stenciljs_deployment.rb
Defined Under Namespace
Classes: CdnDeployment, CdnStenciljsDeployment, Cli, CustomDeployment, Deployment, KubernetesDeployment
Constant Summary
collapse
- DEPLOYMENTS =
{
cdn: 'CdnDeployment',
cdn_stenciljs: 'CdnStenciljsDeployment',
custom: 'CustomDeployment',
kubernetes: 'KubernetesDeployment',
}.freeze
Class Method Summary
collapse
Class Method Details
.call(stage, options) {|deployment| ... } ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/afterlife/deploy.rb', line 14
def call(stage, options)
deployment = klass.new(options)
Afterlife.current_stage = stage
fill_env
deployment.setup
yield deployment
deployment
end
|
.current_type ⇒ Object
30
31
32
33
34
|
# File 'lib/afterlife/deploy.rb', line 30
def current_type
Afterlife.current_repo.conf.dig(:deploy, :type).tap do |result|
fail Error, 'deploy.type must be defined if you want to deploy with Afterlife' unless result
end
end
|
.klass ⇒ Object
23
24
25
26
27
28
|
# File 'lib/afterlife/deploy.rb', line 23
def klass
klass = DEPLOYMENTS[current_type.gsub('-', '_').to_sym]
fail Error, "deployment type '#{current_type}' is invalid" unless klass
const_get(klass)
end
|