cookbook 'capish', '= 0.1.0'
capish (7) Versions 0.1.0 Follow0
Simple Capistrano-like code deployment.
cookbook 'capish', '= 0.1.0', :supermarket
knife supermarket install capish
knife supermarket download capish
capish
Capish is a simple cookbook for deploying code from git repositories a la
Capistrano. A repo is set up to track a remote branch, and deploys a new
clone when a new commit is detected.
Rollbacks are not supported; to roll back to an earlier version
of the code, force push to your tracking branch so it points to the desired
revision, or use tags instead. New checkout directories are created both to
encourage maintaining a stateless app and to abandon any existing cached
files like compiled scripts and stylesheets, etc. so they can be rebuilt
in a fresh directory.
If automatically tracking a branch isn't your thing, you can use revisions
or tags instead. Triggering a code deployment is as simple as updating your
cookbook recipe to use the new revision/tag.
Capish uses the git gem to interact with local and remote repositories.
Example
capish_repo 'my repo' do repository 'https://github.com/paulholden2/capish' deploy_key '<your SSH private key here>' checkout_alias 'staging' destination '/var/www/capish' branch 'deploy' action :checkout, :deploy # See "About :deploy" below end
capish_repo
Properties
Property | Type | Required | Default | Description |
---|---|---|---|---|
repository | String | true | Your remote repository's URL. | |
deploy_key | String | The deploy SSH key to use when accessing the repository. | ||
destination | String | true | The target directory for deployment. | |
checkout_alias | String | next | The alias for checkouts, used as the working directory for tasks before the :deploy action is executed. |
|
branch | String | Which branch to check out. If not defined, you must define a tag. | ||
tag | String | Which tag to check out. If not defined, you must define a branch. | ||
user | String | root | The owner of the checkout directories. | |
group | String | root | The group of the checkout directories. | |
mode | String | 0755 | The mode to assign to checkout directories. | |
timestamp_format | String | %Y%m%d.%H%M%S%L | What format to use when creating checkout directories. | |
timestamp | Time | Time.now |
The timestamp for the deployment. Default is the time of resource definition. |
Actions
Action | Default | Description |
---|---|---|
checkout | Yes | Runs the clone action, then checks out the most recent revision in your branch, or at your tag. |
clone | No | Clones the repo if it doesn't already exist. |
deploy | No | Create the current symlink in the destination directory, to the checkout. Does nothing if no checkout was created. |
unstage | No | Removes the checkout directory and checkout alias symlink. This action does not roll back the local repo to the previous revision. You will have to push a new commit to your branch or update your tag with fixes to trigger another checkout. Execute this action if e.g. your build task fails. |
About :deploy
You will have to notify your capish_repo resource with the
:deploy
action before your code is actually deployed. This is not done
automatically both to prevent deploying code that needs build tasks to run,
and to avoid deploying a failed build. Typically you will do something
like:
capish_repo 'my repo' do # Repo configuration ... notifies :build, 'other[resource]' end other 'resource' do # Doing my build here ... notifies :deploy, 'capish_repo[my repo]' end
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
capish CHANGELOG
This file is used to list changes made in each version of the capish cookbook.
Collaborator Number Metric
0.1.0 failed this metric
Failure: Cookbook has 0 collaborators. A cookbook must have at least 2 collaborators to pass this metric.
Contributing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.0 passed this metric
No Binaries Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 failed this metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Foodcritic Metric
0.1.0 passed this metric
No Binaries Metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 passed this metric
0.1.0 passed this metric
Testing File Metric
0.1.0 failed this metric
Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
0.1.0 passed this metric
0.1.0 failed this metric
0.1.0 passed this metric