The service is being hosted on my raspberry pi so I apologise if it seems a bit slow. If it goes down for any reason drop me an email.
The code was written using flask and flask-restful, and the requests library for communicating with github. It is deployed with fabric and served with apache and wsgi.
I've deployed the code with the dev config. This is because flask only pretty prints json results when debug is true and I thought that would be a bit easier for you to read.
http://bmcalindin-asi.ddns.net/user/username/repo/
- limit - integer (default=5) - the maximum number of repos to show
- orderby - string (default=size) - the field to sort the results by
Fabric was used for the deployment
- Github repo is checked out to /rootdir/releases/commit_timestamp
- Bootstrap script is ran to setup virtualenv and install packages
- The checkout is symlinked to /rootdir/releases/current
- Apache is restarted
- The checkouts and bootstrap should be done in parallel on all servers. Once that is done all servers should be switched and restarted in parallel in ensure that they are kept in sync as much as possible.
- Normally part of my deployment code would remove old versions, keeping something like the 5 most recent deployments. I just forgot to do this.
I've added some unit tests for the repo controller. Obviously this could have a lot more tests, this was just an example. As well as more unit tests I would probably add some end-to-end integration tests that communicate with github. The tests are ran with:
./scripts/test
- I messed up the apache config a bit. Normally I would keep the default config and add one line to include /rootdir/releases/current/conf/app_server.conf. This would contain a virtual host with everything relevant to this deployment.
- My server isn't setup properly at all. I took this as more of a coding/deployment challenge rather than an infrastructure challenge.
- More tests
- I'm less experienced with flask than django so perhaps some of the create app boiler plate isn't perfect
- Logging isn't setup properly