cookbook 'deploy_artifact', '= 1.0.0'
deploy_artifact (8) Versions 1.0.0 Follow0
A cookbook with library to deploy local files
cookbook 'deploy_artifact', '= 1.0.0', :supermarket
knife supermarket install deploy_artifact
knife supermarket download deploy_artifact
deploy_artifact
Overview
This cookbook provides a simple deploy_artifact
resource that will deploy a single binary or tar.gz file. The deployment process is designed to mirror the Deploy Resource except designed to be used only for local deployments and not GIT. It is assumed that a directory called cached-copy
will already contain the contents of what is to be deployed. It is left up to you on how to deliver the artifact while the resource will do the work to deploy it.
Given a file
location and path
, the resource will:
- Create a directory structure:
path\
cached-copy\
releases\
<CHECKSUM>\
current -> releases\<CHECKSUM>
- Assume the file
is a single binary or gziped tar file
- Create a releases directory and release directory named as the MD5 checksum of the deployed file
in path
- On successful completion, symlink the release directory releases\<CHECKSUM>
to path\current
Resources\Providers
-
deploy_artifact
- performs deployment of a local artifact on a server
Actions
-
deploy
: default action, will deploy a givenfile
to a givenpath
:deploy
Resource Parameters for :deploy
-
name
: defaults tofile
parameter -
file
: path to binary ortar.gz
file to deploy, Required -
path
: path to location to deploy to, Required -
owner
: owner of the deployed files, Default: root -
group
: group of the deployed files, Default: root -
before_symlink
: callback which takes a Ruby block of code to execute before symlinking a release to current, Default: nothing -
restart_command
: callback which takes a Ruby block of code to execute after symlinkinga release to current which can be used to restart applications if needed, Default: nothing
Examples
Deploy tarball from Rackspace Cloud Files
rackspacecloud_file '/var/www/app/cached-copy/deploy.tar.gz' do
directory 'deploy.tar.gz'
rackspace_username 'username'
rackspace_api_key 'api_key'
rackspace_region 'dfw'
action :create
end
deploy_artifact 'deploy.tar.gz' do
path '/var/www/app'
action :deploy
end
Deploy tarball and restart service
deploy_artifact 'deploy.tar.gz' do
path '/var/www/app'
action :deploy
restart_command do
service 'unicorn-app' do
action :restart
end
end
end
Contributing
- Fork the repository on Github
- Create a named feature branch (i.e.
add-my-feature
) - Write your change
- Write tests for your change (if applicable)
- Run the tests, ensuring they all pass
- Submit a Pull Request
License and Authors
Authors:: Justin Seubert (justin.seubert@rackspace.com)
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
deploy_artifact CHANGELOG
0.0.1
- First Version