Permalink
Browse files

Deployment: works for me. Stu, please test

  • Loading branch information...
1 parent 9041792 commit d19be3d989700344dbb72e7109abaf0962406a93 @muness muness committed Sep 17, 2010
Showing with 9 additions and 6 deletions.
  1. +3 −0 Capfile
  2. +4 −5 config/bootstrap.rb
  3. +2 −1 config/deploy.rb
View
3 Capfile
@@ -0,0 +1,3 @@
+load 'deploy' if respond_to?(:namespace) # cap2 differentiator
+Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
+load 'config/deploy'
View
9 config/bootstrap.rb
@@ -12,13 +12,12 @@
end
task :create_app_user do
- app_user = "richservices"
- sudo "sh -c '(id #{app_user}) || /usr/sbin/useradd -s /bin/bash -m #{app_user}'"
- home = "/home/#{app_user}"
+ sudo "sh -c '(id #{non_privileged_user}) || /usr/sbin/useradd -s /bin/bash -m #{non_privileged_user}'"
+ home = "/home/#{non_privileged_user}"
sudo "mkdir -p #{home}/.ssh"
sudo "cp ~/.ssh/authorized_keys #{home}/.ssh/authorized_keys"
- run "sudo -H -u #{app_user} sh -c 'cd && curl --silent -OL http://github.com/technomancy/leiningen/raw/stable/bin/lein && chmod +x lein && ./lein self-install'"
- sudo "chown -R #{app_user}:#{app_user} #{home}"
+ run "sudo -H -u #{non_privileged_user} sh -c 'cd && curl --silent -OL http://github.com/technomancy/leiningen/raw/stable/bin/lein && chmod +x lein && ./lein self-install'"
+ sudo "chown -R #{non_privileged_user}:#{non_privileged_user} #{home}"
sudo "chmod 700 #{home}/.ssh"
sudo "chmod 600 #{home}/.ssh/authorized_keys"
end
View
3 config/deploy.rb
@@ -12,7 +12,8 @@
set :copy_compression, :bz2 # Also valid are :zip and :bz2
set :use_sudo, !!ENV["SUDO"]
-set :domain, ENV['SERVER'] || abort("Error - You must specify a server to deploy to as an environment variable - for example: 'SERVER=web01.example.com cap deploy'")
+#set :domain, ENV['SERVER'] || abort("Error - You must specify a server to deploy to as an environment variable - for example: 'SERVER=web01.example.com cap deploy'")
+set :domain, '173.203.59.138'
set :non_privileged_user, application
set :user, ENV["CAP_USER"] || non_privileged_user

0 comments on commit d19be3d

Please sign in to comment.