@pmackay - As there’s a growing need to roll out new servers, I’d like to improve the documentation of our provisioning setup and make it easier for someone coming in to the project to find what they need to do to get a new server up and running.
I’ve made a start by putting some notes at the top of the git repository README files to make people aware of the other repository. So if they come across openfoodnetwork, they’ll be made aware of ofn_deployment, and vice versa.
Beyond that, it’d be great to have some sort of introduction or getting started guide. Would you be up for writing up some notes on this discourse page for that? I’m thinking it’d be good to:
Explain the purposes of repositories - openfoodnetwork vs ofn_deployment
Have some notes on how to practice / experiment with provisioning with vagrant
Also wanting to look more at how we can improve the deployment process to dig into it during the hack days. I quite like the idea of updating ofn_deployment with a template post receive hook file that could be added to a new repo project. Does that sound ok as part of a plan? So some steps might be:
Update ofn_deployment to configure post receive hook, so deployment happens following a git push.
Update docs on how to do provisioning/deployment accounting for this. (is Discourse the best place or might a wiki page or the manual be better?)
Review the files under scripts/ci to make more generic so can be used for any server.
Test configuring another project in Buildkite to make UK deployment simpler.
Would be interested in your thoughts on how the CI scripts could be made more configurable - there are quite a lot of hardcoded paths containing openfoodweb, etc, which I assume is legacy naming of server config. I do wonder if they could be ansible too (would that make variables config easier maybe?) particularly as there are some SSH operations in there. Could it make maintainability easier? But obviously the scripts are there now and work.
Great That sounds like a good plan for the hack day. I think that discourse is a good starting point for documentation and a good fallback if we’re not sure where something goes, but I think we also talked about putting the more technical documentation on the github wiki. Along those lines, what do you reckon of having the deployment docs on the ofn_deployment github wiki, and perhaps reference them from the README?
Buildkite makes it easy to pass environment variables to build scripts. So I think passing a RAILS_ROOT var might be enough to solve a lot of those problems. However, for the moment it should be possible for Aus and UK to share a build server, especially since we’d most commonly be using it at different times of the day. In that case we wouldn’t need to make any changes to the CI scripts in the short-term, apart from extending the push_to_staging script to be able to push to the UK server. Or were there other customisations you were thinking of performing?
Buildkite triggers those scripts from a checkout of the openfoodnetwork repository, so unfortunately it would be tricky for them to be provided by Ansible.
One thing I realised today is that the Ansible playbooks probably don’t include Monit/DelayedJob setup. Would that be something you could potentially tackle at the hackathon?