Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1 from cldwalker/master

update readme and scripts
  • Loading branch information...
commit 31d59aaee6919a93c757f2b99fef462ad655b6d4 2 parents c07d467 + 9b9f3a0
@mtnygard authored
Showing with 17 additions and 11 deletions.
  1. +3 −5 README.md
  2. +4 −3 launch.rb
  3. +10 −3 scripts/bootstrap
View
8 README.md
@@ -7,10 +7,8 @@ and QA environments.
## Bootstrap your environment
- rvm use 1.8.7
- rvm gemset create metron
- gem install bundler
- bundle install
+ ./scripts/bootstrap
+ . .rvmrc
## Configure for EC2
@@ -33,7 +31,7 @@ And so on.
## Commands
-scripts/launch.rb
+./launch.rb
Bootstrap and configure a new instance on EC2.
vagrant up
View
7 launch.rb
@@ -1,5 +1,6 @@
-#! /usr/bin/env ruby -rubygems
+#!/usr/bin/env ruby
+require 'rubygems'
require 'yaml'
require 'fog'
require 'net/sftp'
@@ -53,14 +54,14 @@ def upload(session, local, remote)
Net::SSH.start( server.dns_name, 'ubuntu', :keys => [ ssh_key_file ], :paranoid => false ) do |ssh|
puts "Uploading payload files"
-
+
upload(ssh, "tmp/chef-solo.tgz", "/tmp/chef-solo.tgz")
upload(ssh, "config/solo.rb", "/home/ubuntu/solo.rb")
upload(ssh, "config/dna.json", "/home/ubuntu/dna.json")
upload(ssh, "config/bootstrap.sh", "/home/ubuntu/bootstrap.sh")
puts "Running bootstrap"
-
+
ssh.exec!("sudo sh ./bootstrap.sh") do |channel, stream, data|
puts data
end
View
13 scripts/bootstrap 100644 → 100755
@@ -1,9 +1,16 @@
#! /usr/bin/env bash
-[ rvm use 1.8.7 ] || ( rvm install 1.8.7 && rvm use 1.8.7 )
+source ~/.rvm/scripts/rvm
+rvm use 1.8.7
+if [[ 0 -ne $? ]]
+then
+ rvm install 1.8.7
+ rvm use 1.8.7
+fi
-rvm gemset create metron
+rvm gemset create metron
+rvm gemset use metron
gem install bundler
bundle install
-
+mkdir -p tmp
Please sign in to comment.
Something went wrong with that request. Please try again.