README.md in torquebox-remote-deployer-0.1.1 vs README.md in torquebox-remote-deployer-0.1.2.pre1

- old
+ new

@@ -27,11 +27,11 @@ TorqueBox::RemoteDeploy.configure do torquebox_home "/opt/torquebox" hostname "localhost" port "2222" user "vagrant" - key "#{ENV["GEM_HOME"]}/gems/vagrant-0.8.7/keys/vagrant" + key "~/.vagrant.d/insecure_private_key" sudo true end Of course, fill in the values with your own server information. Then you can stage your application on the remote server with this command: @@ -41,20 +41,41 @@ This will create a Knob file, copy it to the remote server, and explode it to a location where commands can be run from its root directory; like this: $ rake torquebox:remote:exec["bundle install --path vendor/bundle"] -Now you can to do more useful things like running migrations: +Or if you ran `bundle --deployment` before creating your Knob you can just jump right in and run something more useful like your migrations: - $ rake torquebox:remote:exec["rake db:migrate RAILS_ENV=production"] + $ rake torquebox:remote:exec["bundle exec rake db:migrate"] After the `exec` tasks are complete, you can deploy the Knob to the TorqueBox server. $ rake torquebox:remote:deploy This task works just like the `torquebox:deploy:archive` task, but remotely. +## Deploying to Multiple Environments + +The `torquebox-remote-deployer` gem defaults to production mode, so all the examples shown above will execute with your `production` Bundler group and db config. But it's most likely that you will want to deploy to a staging or test environment before deploying to production. In that case, you'll need a config file for each one. In each config file, you can specify the RACK_ENV or RAILS_ENV like this: + + TorqueBox::RemoteDeploy.configure do + torquebox_home "/opt/torquebox" + hostname "localhost" + port "2222" + user "vagrant" + key "~/.vagrant.d/insecure_private_key" + + # set the RAILS_ENV on the remote server + rails_env "staging" + end + +Then you can deploy with the `TB_REMOTE_FILE` environment variable set like this: + + $ export TB_REMOTE_FILE=config/torquebox_remote.staging.rb + $ rake torquebox:remote:stage + +You can name the config file whatever you'd like, and you can have one per environment -- but use the same Rake tasks. + ## TODO * Make it friendly to remote Windows targets (already works on Windows source machines). -* Support deploying to mutliple servers (config would look like multi-hosts in a Vagrantfile) * Support deploying over FTP or SFTP in addition to SCP/SSH. \ No newline at end of file