Forum: Ruby on Rails SwitchTower: Two development environments

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Dcbf676f860477e44b275cae5d6318a4?d=identicon&s=25 Piotr Usewicz (lopmx)
on 2006-03-01 19:10
(Received via mailing list)
Hi

	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?

Thanks,
Peter
24d2f8804e6bb4b7ea6bd11e0a586470?d=identicon&s=25 Jeremy Kemper (Guest)
on 2006-03-01 19:43
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mar 1, 2006, at 10:07 AM, Piotr Usewicz wrote:
> 	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)

iD8DBQFEBetLAQHALep9HFYRAuetAJ48uOkb/i2Tl13x85FbhHemeHAReQCgoJbZ
ZbkWezUDJYOZCsPs+NciVjQ=
=ekiI
-----END PGP SIGNATURE-----
24d2f8804e6bb4b7ea6bd11e0a586470?d=identicon&s=25 Jeremy Kemper (Guest)
on 2006-03-01 20:20
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mar 1, 2006, at 10:43 AM, Jeremy Kemper wrote:
> 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)

iD8DBQFEBfPKAQHALep9HFYRAqSaAJ4lv4I8PDgOHhwV0B4ZpIxyNl1CbQCgmXP0
FFV68BDtltnuG5U/z64uVVo=
=5rpZ
-----END PGP SIGNATURE-----
992fe8c19bbbc27f2b562a9f96efc03d?d=identicon&s=25 Jamis Buck (Guest)
on 2006-03-01 20:56
(Received via mailing list)
On Mar 1, 2006, at 11:07 AM, Piotr Usewicz wrote:

> Hi
>
> 	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:

   http://jamis.jamisbuck.org/articles/2006/01/03/usi...
with-multiple-deployment-stages

Hope that helps,

- Jamis
This topic is locked and can not be replied to.