Skip to content

Udot/cuddy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cuddy, the handy deployer

Cuddy is a deployer node. It picks up a queue (jsoned array) in a Redis server using his personal token as key, and then grab each hash in there to do his work.

    {"version" => integer,       #the version number
     "name" => string,            #the name of the app
     "status" => string,          #starts with "waiting"
     "started_at" => datetime,    #the time when the app was added in the queue
     "finished_at" => datetime,   #the time when the app was properly deployed
     "backoffice" => boolean,      # is the app a backoffice thing (will not create db and use different init script)
     "config" => { "unicorn" => { "workers" => integer },
       "db" => {"hostname" => string, "database" => string, "username" => string, "token" => string}
     }

Cuddy will expect to get a tar file named like : name-version.tgz from RackSpace CloudFiles, then it will extract it into /var/www. The tar file is expected to have name/version/ as base path (all the app stuff must be in this path in the tar ball). Once extracted action will depend on the backoffice status of your app.

NOTE : cuddy doesn't run a bundle install it expects that the tar ball is a ready to run copy of your app. In clear : you must have (one way or another) bundled all the gems of your app with it. remember to do such install on a server that has as close as possible installed setup to your hosting server.

Backoffice

Backoffice status is defined with "backoffice" => true in the hash. In this case, cuddy will :

  1. call send QUIT signal to the running unicorn (located in /var/www/shared/pids/unicorn-appname.pid)
  2. destroy the previous version symlink if it exists
  3. create a symlink named current pointing to the new version in /var/www/appname
  4. start the unicorn using bundle exec command, passing both approot/config.ru and approot/config/unicorn.rb files and using production as environment.

Normal

To come

Requirements

You need a working ruby 1.9.2 environment with at least the bundler, unicorn gems installed in there.

Setup and start

Copy the sample config file and edit it to your needs. Run bundle install, and start the daemon using ruby cuddy_control start.

License

MIT, see License file.

Releases

No releases published

Packages

No packages published

Languages