Skip to content

Commit

Permalink
Update launch script for non-AppFolio changes
Browse files Browse the repository at this point in the history
  • Loading branch information
noahgibbs committed Mar 4, 2020
1 parent 8787ab8 commit 14a8318
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/launch_instance.rb
Expand Up @@ -5,10 +5,11 @@
# While you might get some useful ideas here, this script is *not* general-purpose
# and will *not* do exactly what you wish it would. It's pretty specific to my workflow.

latest_ami = 'ami-052d56f9c0e718334'
latest_ami = 'ami-0bca9c583e83ac8e8' # This is in us-west-2
inst_name = ENV['INSTANCE_NAME'] || 'RailsRubyBenchTestInstance'
inst_type = ENV['INSTANCE_TYPE'] || 'm4.2xlarge'
json_out = `aws ec2 run-instances --count 1 --instance-type #{inst_type} --key-name noah-packer-1 --placement Tenancy=dedicated --image-id #{latest_ami} --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=#{inst_name}}]'`
placement = ENV['PLACEMENT'] ? "--placement #{ENV['PLACEMENT']}" : "" # --placement Tenancy=dedicated
json_out = `aws ec2 run-instances --count 1 --instance-type #{inst_type} --key-name noah-packer-1 #{placement} --image-id #{latest_ami} --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=#{inst_name}}]'`

ec2_info = JSON.parse(json_out)

Expand All @@ -25,9 +26,8 @@
scp -i ~/.ssh/noah-packer-1.pem ubuntu@#{inst_ip}:~/rails_ruby_bench/data/*.json .
scp -i ~/.ssh/noah-packer-1.pem ubuntu@#{inst_ip}:~/rsb/data/*.json .
aws ec2 terminate-instances --instance-ids #{id}
AppFolio only: assume-role appfolio-dev User MFA_TOKEN
LINES
puts cmd_lines
File.open("#{ENV["HOME"]}/rrb_commands.txt", "w") { |f| f.puts(cmd_lines) }
end

0 comments on commit 14a8318

Please sign in to comment.