Capistrano Flashcards
What is Capistrano?
Capistrano is a utility and framework for executing commands in parallel on multiple remote machines, via SSH. It uses a simple DSL (borrowed in part from Rake) that allows you to define tasks, which may be applied to machines in certain roles. It also supports tunneling connections via some gateway machine to allow operations to be performed behind VPN’s and firewalls.
Capistrano: How do you init a capistrano project?
cd my-project
cap install
Capistrano: What are the tasks in the deploy namespace?
deploy: starting - start a deployment, make sure everything is ready
deploy: started - started hook (for custom tasks)
deploy: updating - update server(s) with a new release
deploy: updated - updated hook
deploy: publishing - publish the new release
deploy: published - published hook
deploy: finishing - finish the deployment, clean up everything
deploy: finished - finished hook
Capistrano: What happens in the deploy:publishing task?
Every deploy is stored in /var/www/my-app/releases/. The built-in task deploy:publishing creates a symbolic link of the recent deploy to the current folder. This way you can keep older releases and switch versions without going offline for a second. When this task ran, your newest version is online.
Capistrano: How can you deploy your app to a stage?
cap custom_stage deploy
Capistrano: How do you rollback your app?
cap production deploy:rollback
Capistrano: What are units of work called?
Tasks
Capistrano: Where can you include extra bundles?
Require them in your capfile
Capistrano: Discuss the :pty setting in deploy.rb
There is a configuration option which asks the backend driver to ask the remote host to assign the connection a pty. A pty is a pseudo-terminal, which in effect means tell the backend that this is an interactive session. This is normally a bad idea.
Capistrano: What mercurial command is used to ‘clean’ releases?
hg archive