def puts_red(heredoc); puts set_color heredoc, :red; end def puts_green(heredoc); puts set_color heredoc, :green; end puts_red "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" puts_red "@@ @@@@@@@@ @@@@@@@@37@@@" puts_red "@ @@@@@ @@@@@@@@@@@@@" puts_red "@ @@@@@ @@@@ @@@@" puts_red "@ @@@@@ @@@@ @@" puts_red "@ @@@@ @@@@@@ @" puts_red "@ @@@@@@@ @@@@@@ @" puts_red "@ @@ @@@@@@ @@@@@@ @" puts_red "@ @@@@ @@@@ @@" puts_red "@@ @@@@@ @@@@@ @@@@" puts_red "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" puts_red "@@@@@@@@ https://www.rubidium.io @@@@@@@@@" puts_red "@@@@@@@@@@@@@@ 85.4678 @@@@@@@@@@@@@@@@@@" puts_red "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" puts "" puts "" # Checks for unstagged commits return_message = "There are unstaged commits. Do you want to continue?" return if !run("git diff --no-patch --exit-code") && no?(return_message) # TEMPLATE START run "bundle install" run "bundle add eb_deployer" run "bundle add webrick" run "bundle add rails-healthcheck" run "bundle install" generate("healthcheck:install") # generate eb_deployer config file run "eb_deploy" # clone beanstalk_dotfiles run "git clone https://github.com/jeremiahlukus/beanstalk_dotfiles.git" # move files into root project run "mv beanstalk_dotfiles/.ebextensions/ ." run "mv beanstalk_dotfiles/.platform/ ." # add stack to line 8 on eb_deployer.yaml run "sed -i -e '8r beanstalk_dotfiles/stack.yaml' config/eb_deployer.yml" # add db and redis env vars and instance profile to beanstalk env run "sed -i -e '117r beanstalk_dotfiles/standard_setup.yaml' config/eb_deployer.yml" run "sed -i -e '18r beanstalk_dotfiles/puma_config.rb' config/puma.rb" # change to a bigger ec2 run "sed -i -e 's/m1.small/c3.large/g' config/eb_deployer.yml" # latest supported aws ruby version  run "echo '3.0.2' > .ruby-version" if yes?("Do you want to setup an RDS? [y/n]")   run "mv beanstalk_dotfiles/cf_rds.json config/cf_rds.json"   run "mv beanstalk_dotfiles/example_deploy.sh ."   run "sed -i -e '166r beanstalk_dotfiles/rds.yml' config/eb_deployer.yml"   run "sed -i -e 's/dev/staging/g' config/eb_deployer.yml"   run "sed -i -e '67r beanstalk_dotfiles/database.yml' config/database.yml"   run "rm -f config/database.yml-e" end # clean up run "rm -f config/puma.rb-e" run "rm -rf beanstalk_dotfiles/" run "rm -f config/eb_deployer.yml-e" run "echo 'If you chose to create a database you will need to deploy two times, the first time will create the database, then you need to set the database creds as ENV vars so your app can connect to it'" # TEMPLATE END puts "" puts "" puts_green "Template Name: Elastic Beanstalk Ruby 3.0.2" puts_green "By: jeremiahlukus1 (https://www.rubidium.io/profiles/jeremiahlukus1)" puts_green "https://www.rubidium.io/templates/elastic-beanstalk-ruby-3-0-2"