Class: Brut::CLI::Apps::Deploy::Heroku
- Inherits:
-
Commands::BaseCommand
- Object
- Commands::BaseCommand
- Brut::CLI::Apps::Deploy::Heroku
- Defined in:
- lib/brut/cli/apps/deploy.rb
Instance Attribute Summary
Attributes inherited from Commands::BaseCommand
Instance Method Summary collapse
Methods inherited from Commands::BaseCommand
#accepts, #args_description, #argv, #bootstrap?, #commands, #default_command, #default_command_class, #default_rack_env, #env, #env_vars, #execute, #name, #options, #opts, #puts, #stderr, #stdin, #stdout, #system!
Instance Method Details
#description ⇒ Object
9 |
# File 'lib/brut/cli/apps/deploy.rb', line 9 def description = "Deploy to Heroku using container-based deployment" |
#run ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/brut/cli/apps/deploy.rb', line 10 def run version = "" git_guess = %{git rev-parse HEAD} system!(git_guess) do |output| version << output end version.strip!.chomp! if version == "" stderr.puts "Attempt to use git via command '#{git_guess}' to figure out the version failed" return 1 end short_version = version[0..7] app_docker_files = AppDockerImages.new( project_root: Brut.container.project_root, organization: Brut.container.organization, app_id: Brut.container.app_id, short_version: ) #add heroku_image_name: "registry.heroku.com/#{heroku_app_name}/web", #stdout.puts "Taggging images for Heroku" #images.each do |name,metadata| # image_name = metadata.fetch(:image_name) # heroku_image_name = metadata.fetch(:heroku_image_name) # # stdout.puts "Tagging '#{image_name}' with '#{heroku_image_name}' for Heroku" # command = %{docker tag #{image_name} #{heroku_image_name}} # system!(command) # end # # if options.push? # stdout.puts "Pushing to Heroku Registry" # images.each do |name,metadata| # heroku_image_name = metadata.fetch(:heroku_image_name) # # stdout.puts "Pushing '#{heroku_image_name}'" # # command = %{docker push #{docker_quiet_option} #{heroku_image_name}} # system!(command) # end # else # stdout.puts "Not pushing images" # end # # names = images.map(&:first).join(" ") # deploy_command = "heroku container:release #{names} -a #{heroku_app_name}" # if options.deploy? # stdout.puts "Deploying images to Heroku" # system!(deploy_command) # else # stdout.puts "Not deploying. To deploy the images just pushed:" # stdout.puts "" # stdout.puts " #{deploy_command}" # end # end end |