Class: Belt::CLI::FrontendDeployCommand
- Inherits:
-
Object
- Object
- Belt::CLI::FrontendDeployCommand
- Includes:
- AppDetection
- Defined in:
- lib/belt/cli/frontend_deploy_command.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(env) ⇒ FrontendDeployCommand
constructor
A new instance of FrontendDeployCommand.
- #run ⇒ Object
Methods included from AppDetection
Constructor Details
#initialize(env) ⇒ FrontendDeployCommand
Returns a new instance of FrontendDeployCommand.
30 31 32 33 34 |
# File 'lib/belt/cli/frontend_deploy_command.rb', line 30 def initialize(env) @env = env @app_name = detect_app_name @env_dir = "infrastructure/#{@env}" end |
Class Method Details
.run(args) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/belt/cli/frontend_deploy_command.rb', line 13 def self.run(args) env = EnvResolver.resolve(args) if env.nil? puts 'Usage: belt deploy frontend <environment>' puts "\nBuilds the frontend app and deploys to S3 + invalidates CloudFront." puts 'You can also set BELT_ENV to skip the environment argument.' puts "\nExamples:" puts ' belt deploy frontend wups' puts ' belt deploy frontend dev01' puts ' BELT_ENV=wups belt deploy frontend' exit 1 end new(env).run end |
Instance Method Details
#run ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/belt/cli/frontend_deploy_command.rb', line 36 def run validate! build_frontend sync_to_s3 invalidate_cloudfront url = fetch_frontend_url puts "\n✅ Frontend deployed to #{@env}!" puts " #{url}" if url end |