Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tongueroo/cloud_info
easily update the servers for ey cloud capistrano deployments
https://github.com/tongueroo/cloud_info
Last synced: about 1 month ago
JSON representation
easily update the servers for ey cloud capistrano deployments
- Host: GitHub
- URL: https://github.com/tongueroo/cloud_info
- Owner: tongueroo
- License: mit
- Created: 2010-03-05T06:08:19.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2010-03-11T18:45:13.000Z (almost 15 years ago)
- Last Synced: 2024-11-18T00:35:50.957Z (about 2 months ago)
- Language: Ruby
- Homepage:
- Size: 78.1 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: MIT-LICENSE
Awesome Lists containing this project
README
CloudInfo
=======Summary
-------
Assumes you're using engineyard's amazon could. Allows you to use capistrano deployments to engineyard's amazon cloud without having to update your capistrano deploy.rb every time you add in instances in their gui.Install
-------
sudo gem install cloud_info --source http://gemcutter.orgSet up your ~/.ey-cloud.yml file.
Set up your ~/.ssh/id-rsa-flex-key private key.Usage
-------in your deploy.rb
require 'cloud_info'task :production do
ey_env_name = "prod1" # this is the environment name in EY's gui interface
cloud_info = CloudInfo.new(ey_env_name, :private_key => "~/.ssh/id-rsa-flex-key")role :db, cloud_info.app_master, :primary => true
# web and app slices
cloud_info.apps.each do |info|
role :web, info[1]
role :app, info[1], :sphinx => true
end# utility slices
cloud_info.utils.each do |info|
role :app, info[1], :sphinx => true
endset :environment_database, Proc.new { production_database }
set :user, 'deploy'
set :runner, 'deploy'
set :rails_env, 'production'
endTo look at what the hosts contain use script/console. cloud_info.apps, cloud_info.utils just holds a hash of keys and dns_names.
./script/consolerequire "cloud_info"
cloud_info = CloudInfo.new("prod1")
pp cloud_info.apps
{
"prod1_app0" => '123.456.789.123',
"prod1_app1" => 'ec-123.456.789.123.whatever'
}pp cloud_info.hosts # shows all hosts
{
"prod1_app0" => '123.456.789.123', # app_master
"prod1_app1" => 'ec-123.456.789.123.whatever', # app
"prod1_db0" => 'ec-123.456.789.123.whatever', # db_master
"prod1_db1" => 'ec-123.456.789.123.whatever', # db_slave
"prod1_util0" => 'ec-123.456.789.123.whatever', # util instance, name util0
}Compatibility
-------------Tested with Ruby 1.8.6.
Thanks
------