Method: Jets::Commands::Deploy#run

Defined in:
lib/jets/commands/deploy.rb

#runObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/jets/commands/deploy.rb', line 9

def run
  deployment_env = Jets.config.project_namespace.colorize(:green)
  puts "Deploying to Lambda #{deployment_env} environment..."
  return if @options[:noop]

  check_dev_mode
  validate_routes!

  # deploy full nested stack when stack already exists
  # Delete existing rollback stack from previous bad minimal deploy
  delete_minimal_stack if minimal_rollback_complete?
  exit_unless_updateable! # Stack could be in a weird rollback state or in progress state

  if first_run?
    ship(stack_type: :minimal)
    Jets.application.reload_configs!
  end

  # Build code after the minimal stack because need s3 bucket for assets
  # on_aws? and s3_base_url logic
  build_code

  ship(stack_type: :full, s3_bucket: s3_bucket)
end