Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Naive implementation of pull, migrate and precompile

  • Loading branch information...
commit b58ae4d1824ddfb236caf01fd9a48fda109642a8 1 parent 160fd20
@rbgrouleff authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/wheelbarrow/wagonload.rb
View
12 lib/wheelbarrow/wagonload.rb
@@ -7,14 +7,26 @@ def initialize(deployment_dir, repo)
# Git pull from repo to deploy dir
def pull
+ Dir.chdir @deployment_dir do
+ `git pull #{@repo} master`
+ raise "Deployment of code failed" unless $?.exitstatus == 0
+ end
end
# rake db:migrate
def run_migrations
+ Dir.chdir @deployment_dir do
+ puts `RAILS_ENV=production rake db:migrate`
+ raise "Migrating the database failed" unless $?.exitstatus == 0
+ end
end
# asset precompiling
def assets_precompiling
+ Dir.chdir @deployment_dir do
+ puts `RAILS_ENV=production rake assets:precompile`
+ raise "Assets precompiling failed" unless $?.exitstatus == 0
+ end
end
# restart unicorn
Please sign in to comment.
Something went wrong with that request. Please try again.