Automated deploys for CKAN
Ansible roles for automating deploys and rollbacks for CKAN custom installations that need to manage several extensions on active development, and that need to be deployed into several environments.
Summary
This set of roles and scripts provides a framework when working on custom developments of CKAN which involve setting up, developing and deploying several extensions. The main issues it tries to solve are:
- Deploying releases of several CKAN extensions in a capistrano-like way. Each of them coming from different origins:
- Open source extensions developed outside your organization
- Forked open source extensions adapted for your use case
- Private extensions developed by your organization
- Ability to easily rollback a failed deploy
- Encapsulating Python packages dependencies for each of the deploys (using virtualenv)
- Deploying some minor changes to the CKAN core without forking CKAN
- Deploying to several environments (production and staging)
Assumed Setup
We assume you have installed CKAN following the official guide. Tested with CKAN 2.7.2 on a CentOS 7 machine.
Required users and groups:
- root
- apache
- ckan
Getting Started
Clone the repo:
git clone https://github.com/populatetools/ckan-deploys
Copy inventory.example and edit with your server IPs
Fill in the vault files inside sites/ckan/vars
Edit variables in ckan_production.yml, ckan_staging.yml and sites/ckan/vars/ckan_config.yml
How to’s
First Deploy
Run bin/production_first_deploy.sh to prepare the default CKAN installation.
Deploy
Run bin/production_deploy.sh to deploy a new release.
Rollback
Run bin/production_rollback.sh to rollback to the previous release.