An Ansible role that deploy your application just the same way like Capistrano.
Capistrano is software written in Ruby, which allows you to deploy your application on remote node. Here is how it works:
- On remote node you should have in project workdir directories
/shared
,/repository
and/deployments
. - In
/repository
directory there is a copy of your source repo (GIT/SVN etc.) - When you do deploy, capistrano copies repository directory into
/deployments
dir. Name of copied directory is different - it's always current timestamp (like/deployments/20171108123453
). - Next step is to make symlinks of all directories/files from
/shared
directory into the new deployment directory. It allows you to share upload dir or logs directory between deployments. - Last step is to create or change symlink
/current
to point to the latest deployment from/deployments
There aren't any requirements for this role.
Available variables are listed below, along with default values (see defaults/main.yml
).
Workdir for the role. Inside there will be deployed all applications. It can be also customised per project.
deployment_default_workdir: ""
deployment_default_owner: ""
deployment_default_group: ""
deployment_keep_releases: 5
deployment_projects: []
deployment_projects: []
- name: project.name
repository: [email protected]:some/repo
deployment_projects: []
- name: project.name
workdir: /var/www
repository: [email protected]:some/repo
version: "HEAD"
owner: apache
group: apache
shared_files:
- any/path/to/mount/in/dir/deployment/dir
ssh_opts: ""
keep_releases: 2
None.
- hosts: webservers
vars_files:
- vars/main.yml
roles:
- { role: MWojtowicz.deployment }
MIT / BSD
This role was created in 2017 by Michal Wojtowicz.