You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy + paste this into a new deploy key at https://github.com/username/projectname/edit
* ensure that `ssh_options[:keys]` in `config/deploy.rb` contains the correct key name
* add remote projectname user's public ssh key to locally:
* $ vi ~/.ssh/projectname_production_projectname.pub
* add local public ssh key to remote ~projectname/.ssh/authorized_keys
Initialize and Configure the Application
----------------------------------------
Locally, init the remote deploy:
$ cap deploy:cold
Create the remote rails database config file:
$ vi ~projectname/projectname/shared/database.yml
production:
adapter: mysql
host: localhost
username: projectname_prod
password: password
database: projectname_production
timeout: 5000
encoding: UTF8
socket: /var/run/mysqld/mysqld.sock
Load the initial schema:
$ cd ~projectname/projectname/current
$ RAILS_ENV=production rake db:schema:load
Deploy the Application
----------------------
At this point, ensure that all code (including the updated `config/deploy.rb`) is checked in locally, merged onto the `deploy` branch, and pushed to github.
Then, locally:
Set up environment variables if necessary
-----------------------------------------
$ cat .ssh/environment
AMAZON_ACCESS_KEY_ID='KEYYY'
AMAZON_SECRET_ACCESS_KEY='SECRETTT'
$ cap deploy
make sure /etc/ssh/sshd_config contains:
PermitUserEnvironment yes
Confirm that the app is running at [http://projectname.com](http://projectname.com).
Might have to restart ssh with sudo /etc/init.d/ssh restart
TODO
----
Deploy!
-------
Create the following directories if they don't exist:
/home/application/deploy/releases
/home/application/shared/log
* fix cache thing
* cap deploy todos
* cap to after deploy:cold create:
* mkdir ~projectname/projectname/releases
* mkdir ~projectname/projectname/shared/log
* also pids + system dirs
TODO:
MySQL setup
luke0x
revised
this gist May 29, 2009.
1 changed file
with
2 additions
and
2 deletions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
copy + paste this into a new deploy key at https://github.com/username/projectname/edit
* ensure that `ssh_options[:keys]` in `config/deploy.rb` contains the correct key name
* add remote projectname user's public ssh key to locally:
* $ vi ~/.ssh/projectname_production_projectname.pub
* add local public ssh key to remote ~projectname/.ssh/authorized_keys
Initialize and Configure the Application
----------------------------------------
Locally, init the remote deploy:
$ cap deploy:cold
Create the remote rails database config file:
$ vi ~projectname/projectname/shared/database.yml
production:
adapter: mysql
host: localhost
username: projectname_prod
password: password
database: projectname_production
timeout: 5000
encoding: UTF8
socket: /var/run/mysqld/mysqld.sock
Load the initial schema:
$ cd ~projectname/projectname/current
$ RAILS_ENV=production rake db:schema:load
Deploy the Application
----------------------
At this point, ensure that all code (including the updated `config/deploy.rb`) is checked in locally, merged onto the `deploy` branch, and pushed to github.
Then, locally:
$ cap deploy
Confirm that the app is running at [http://projectname.com](http://projectname.com).