Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Capistrano

qutic
October 01, 2013

 Capistrano

Deployment mit Capistrano

qutic

October 01, 2013
Tweet

More Decks by qutic

Other Decks in Programming

Transcript

  1. ‣ Inhaber ‚qutic development‘ : Beratung, Entwicklung und Hosting ‣

    Software-Entwicklung seit 1983 ‣ Start mit Basic und Assembler auf dem C64 ‣ Seit 1993 MacOS, ab 2000 MacOS X: C, Objective-C ‣ Web-Entwicklung mit Ruby (On Rails) seit Ende 2005
  2. ‣ Applikation aus scm auschecken und auf Server kopieren ‣

    Wartungsseite schalten ‣ Hintergrund-Prozesse beenden ‣ fehlende Bibliotheken nachinstallieren ‣ Datenbank migrieren ‣ Ordner in Projekt hineinlinken (files, logs, etc) ‣ Hintergrund-Prozesse wieder starten ‣ Memcache-Instanz zurücksetzen (flush_all) ‣ Sphinx-Datenbank indizieren und Prozess neu starten ‣ Applikation neu starten ‣ Wartungsseite entfernen ‣ Alte Deployments entfernen
  3. set :location, "radiantmagic.com" set :user, "radiantic" set :port, 10900 set

    :use_sudo, false set :application, "radiantic" set :scm, :git set :repository, "git@mein-git-srv:radiantic.git" set :branch, "master" set :deploy_via, :rsync_with_remote_cache set :deploy_to, "/export/home/#{user}/www/#{application}"
  4. desc "Migrate database" task :migrate, :roles => :db do run

    "cd '#{current_path}' && /rake db:migrate" end desc "Delete cache" task :cache_clear, :roles => :worker do delete "#{shared_path}/tmp/cache", :recursive => true end desc "Restart application" task :restart, :roles => :app do run "touch '#{current_path}/tmp/restart.txt'" end desc "Restart Webserver" task :restart_webserver, :roles => : app do sudo "/etc/init.d/apache2 restart" end
  5. namespace :dj do desc "Start delayed_job backgound worker" task :start,

    :roles => :worker do run "'#{current_path}/script/delayed_job' start -n 4" end desc "Stop delayed_job backgound worker" task :stop, :roles => :worker do run "'#{current_path}/script/delayed_job' stop" end desc "Restart delayed_job backgound worker" task :restart, :roles => :worker do stop start end end
  6. GUI

  7. task "puppet:stop" task "puppet:start" task "puppet:restart" task "zone:stop" task "zone:start"

    task "zone:restart" task "db:switch_master" task "db:switch_proxy"
  8. ?

  9. Quellen ‣ https://github.com/capistrano/capistrano ‣ http://de.wikipedia.org/wiki/Capistrano_(Software) ‣ http://www.capistranorb.com ‣ http://weblog.jamisbuck.org/2005/8/5/introducing-switchtower ‣

    http://weblog.jamisbuck.org/2006/3/6/switchtower-renamed ‣ https://github.com/peritor/webistrano ‣ https://www.harrow.io ‣ http://stackoverflow.com/questions/tagged/capistrano