Skip to content

Commit

Permalink
Merge pull request #1 from cldwalker/master
Browse files Browse the repository at this point in the history
update readme and scripts
  • Loading branch information
mtnygard committed Apr 18, 2012
2 parents c07d467 + 9b9f3a0 commit 31d59aa
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
8 changes: 3 additions & 5 deletions README.md
Expand Up @@ -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

Expand All @@ -33,7 +31,7 @@ And so on.

## Commands

scripts/launch.rb
./launch.rb
Bootstrap and configure a new instance on EC2.

vagrant up
Expand Down
7 changes: 4 additions & 3 deletions launch.rb
@@ -1,5 +1,6 @@
#! /usr/bin/env ruby -rubygems
#!/usr/bin/env ruby

require 'rubygems'
require 'yaml'
require 'fog'
require 'net/sftp'
Expand Down Expand Up @@ -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
Expand Down
13 changes: 10 additions & 3 deletions 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

0 comments on commit 31d59aa

Please sign in to comment.