Skip to content
Browse files

i have a shiny new deploy rakefile

  • Loading branch information...
1 parent beecf68 commit b6540a465c26f387651ec782a0d76e5fc00d821c @charliesome committed
Showing with 17 additions and 16 deletions.
  1. +0 −16 Makefile
  2. +17 −0 lib/tasks/deploy.rake
View
16 Makefile
@@ -1,16 +0,0 @@
-PRODUCTION_HOST=voze.org
-PRODUCTION_USER=voze
-PRODUCTION_DIR=/srv/http/voze/rails
-
-deploy:
- ssh $(PRODUCTION_USER)@$(PRODUCTION_HOST) \
- 'cd $(PRODUCTION_DIR) && git reset --hard HEAD && git pull && make prod-deploy'
-
-# all targets starting with prod- are intended to be run automatically on the
-# production machine. do not run them manually
-
-prod-deploy:
- sudo bundle install
- bundle exec rake assets:precompile RAILS_ENV=production
- bundle exec rake db:migrate RAILS_ENV=production
- touch tmp/restart.txt
View
17 lib/tasks/deploy.rake
@@ -0,0 +1,17 @@
+task :deploy do
+ production_host = "voze.org"
+ production_user = "voze"
+ production_dir = "/srv/http/voze"
+
+ cmds = [
+ "cd #{production_dir}",
+ "git reset --hard",
+ "git pull",
+ "sudo bundle install",
+ "bundle exec rake assets:precompile RAILS_ENV=production",
+ "bundle exec rake db:migrate RAILS_ENV=production",
+ "touch tmp/restart.txt"
+ ]
+
+ system "ssh #{production_user}@#{production_host} '#{cmds.join " && "}'"
+end

0 comments on commit b6540a4

Please sign in to comment.
Something went wrong with that request. Please try again.