Capistrano Flashcards

1
Q

What is Capistrano?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Capistrano: How do you init a capistrano project?

A

cd my-project

cap install

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Capistrano: What are the tasks in the deploy namespace?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Capistrano: What happens in the deploy:publishing task?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Capistrano: How can you deploy your app to a stage?

A

cap custom_stage deploy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Capistrano: How do you rollback your app?

A

cap production deploy:rollback

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Capistrano: What are units of work called?

A

Tasks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Capistrano: Where can you include extra bundles?

A

Require them in your capfile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Capistrano: Discuss the :pty setting in deploy.rb

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Capistrano: What mercurial command is used to ‘clean’ releases?

A

hg archive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly