-
-
Notifications
You must be signed in to change notification settings - Fork 112
Deployment with Ansible
This gets a copy of openfoodnetwork from a git repo that your specify (in vars.yml
), put it onto the server, and then does ruby/rake/rails tasks and configuration needed so that it can run. The main tasks accomplished are:
- copy OFN from a git repo to the server
- create the database if needed
- run database migrations
- precompile assets used by OFN
- creates seed data
- creates an initial admin user
This list isn't comprehensive; those are the highlights.
Make sure that the git repo has the OFN code (e.g. by pushing code to your repo or branch, or cloning from a different repo), then run:
ansible-playbook deploy.yml -i staging
(with -vvvv
for full debug output)
to deploy it onto the server(s).
There is a timestamped backup process included in deployment and a rollback version saved each time.
If the deployment script fails after the "Create a repo backup version" task you may need to roll it back to have a functional site, by running:
ansible-playbook rollback.yml -i staging
Failures before this don't need rollback, and it will not run. Just run deployment again. This could be automated at some point.
Backups will be stored by default in ofn_deployment/backups
.
To backup on the server and to the local machine run:
ansible-playbook backup.yml -i staging
Note: This doesn't clean up old backups automatically yet.
Provisioning
Deployment
Sysadmin
- Running a live OFN Instance
- Sysadmin Guidelines
- Tips for Core Sysadmins
- Performance
- Refreshing a staging server
External services
- Sending emails from OFN
- Email Deliverability
- SSL certificates
- Google Maps
- File storage
- Backups
- Server monitoring
- Issue reporting (Bugsnag)
Contributing