I have a problem here. I am developing an application which has a local
development environment (on my harddisk), a second one for my customer
(for testing new features) and a production environment which runs
actual application online.
How can I setup SwitchTower to have a possibility to deploy just for a
I have a problem here. I am developing an application which has a
local development environment (on my harddisk), a second one for my
customer (for testing new features) and a production environment
which runs actual application online.
How can I setup SwitchTower to have a possibility to deploy just
for a particular server?
You may use separate deployment recipes for each. However, the rake
tasks assume a default config/deploy recipe so you must use the
switchtower command directly or alter deploy.rb.
$ mkdir config/deploy; cd config/deploy
$ ln -s …/deploy.rb production.rb
$ cp production.rb staging.rb
$ vi staging.rb
$ switchtower -r config/deploy/staging -a deploy
Or you may edit your deploy.rb to be
require “#{File.dirname(FILE)}/deploy/#{ENV[‘RECIPE’] ||
‘production’}”
and invoke rake as
rake remote:deploy [RECIPE=production]
rake remote:deploy RECIPE=staging
Best,
jeremy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)
I have a problem here. I am developing an application which has a
local development environment (on my harddisk), a second one for my
customer (for testing new features) and a production environment
which runs actual application online.
How can I setup SwitchTower to have a possibility to deploy just
for a particular server?
In addition to Jeremy’s suggestion, you might want to look at:
Or you may edit your deploy.rb to be
require “#{File.dirname(FILE)}/deploy/#{ENV[‘RECIPE’] ||
‘production’}”
Sorry, this should be
load_paths << “#{File.dirname(FILE)}/deploy”
load(ENV[‘RECIPE’] || ‘production’)
since the contents of deploy.rb are evaluated in the context of a
switchtower configuration object.
and invoke rake as
rake remote:deploy [RECIPE=production]
rake remote:deploy RECIPE=staging
Best,
jeremy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (Darwin)