From 3ecc6c019e7da74abc9c9909fe1bae56bab5b628 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Sat, 4 Aug 2012 15:59:10 +0100 Subject: [PATCH] Added therubyracer to gems. Deploy script should now work. --- Gemfile | 5 ++++- Gemfile.lock | 6 ++++++ controller.rb | 2 ++ deploy.rb | 10 ++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 78f63ec..674fe64 100644 --- a/Gemfile +++ b/Gemfile @@ -1,9 +1,12 @@ source "http://rubygems.org" -# gem "rails" gem "stasis" +gem "therubyracer" gem "hpricot" gem "haml" gem "sass" gem "redcarpet" gem "coffee-script" + +# for deployment +gem "net-ssh" diff --git a/Gemfile.lock b/Gemfile.lock index 93508f6..2adc6d7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -10,7 +10,9 @@ GEM multi_json (~> 1.0) haml (3.1.6) hpricot (0.8.6) + libv8 (3.3.10.4) multi_json (1.3.6) + net-ssh (2.5.2) redcarpet (2.1.1) redis (2.2.2) sass (3.1.20) @@ -21,6 +23,8 @@ GEM slop (~> 2.1.0) tilt (~> 1.3.3) yajl-ruby (~> 1.0.0) + therubyracer (0.10.1) + libv8 (~> 3.3.10) tilt (1.3.3) yajl-ruby (1.0.0) @@ -31,6 +35,8 @@ DEPENDENCIES coffee-script haml hpricot + net-ssh redcarpet sass stasis + therubyracer diff --git a/controller.rb b/controller.rb index 41411d4..2abf3e9 100644 --- a/controller.rb +++ b/controller.rb @@ -3,5 +3,7 @@ ignore /\/stylesheets\/_.*/ ignore /Gemfile.*/ ignore /\/\..+/ ignore /README\.md/ +ignore /danbarbercv/ +ignore /deploy.rb/ layout "layouts/main.html.haml" diff --git a/deploy.rb b/deploy.rb index 7e7fa23..10b1f06 100755 --- a/deploy.rb +++ b/deploy.rb @@ -1,5 +1,7 @@ #!/usr/bin/env ruby +require 'net/ssh' + module CV def CV.check_dir return File.exists? "danbarbercv" @@ -8,6 +10,14 @@ module CV def CV.deploy if check_dir puts "Deploying..." + Net::SSH.start('vps2.danbee.co.uk', 'danbee') do |ssh| + # capture all stderr and stdout output from a remote process + ssh.exec!("cd ~/cv") + ssh.exec!("git pull origin") + ssh.exec!("stasis") + end + else + puts "Please run this from the projects directory." end end end