SEANetMap: Deployment guide
Table of Contents
1 Document status
This is Draft 2015-05-04-01 of John Tigue's deployment guide for the SEANetMap project. This document is specific to the deployment process for version 1.0.x of SEANetMap.
The other documents in this set can be found in the index.
When this document reaches a sufficiently developed state where it is ready for multiple people to edit it, its content will be moved into the SEANetMap's GitHub hosted wiki, entitled Deployment Guide, accessable at the following URL:
https://github.com/codeforseattle/seanetmap/wiki/Deployment-guide
When this document's content resides in the two above mentioned SEANetMap's wiki pages, it can be expected to evolve and track the processes beyond version 1.0.x.
It is hoped that the document will be in the wiki by Thursday, 2015-05-07.
Feedback is most welcome; email such to john@tigue.com.
(The only reason this document is being developed in this fashion is because the author (John Tigue) can write much faster in his "native" editing environment. Editing via GitHib flavored markdown (GFM, the text markup that GitHub wiki pages are authored in) is slower, although exporting to GFM will be desirable once there are multiple people editing this document. Tigue's editing environment can export to GFM.)
1.1 Version history
The version are named with the pattern DATE-SERIAL, where DATE is of the from YYYY-MM-DD and SERIAL is a two digit code, reset to 0l each day. For example, 2015-05-04-01 is the first release of May 4th, 2015.
- 2015-05-05-01
- First public release
2 Introduction
Of the four documents in this set, this is the least well developed.
3 Continuous Integration
- At this time there is none.
- Travis is the way to go with open source projects as they provide a quality service for free (while surreptitiously training an army of sales people, as evidenced by this text).
- Suace Labs and Travis work together
"Sauce Labs provides a Selenium cloud with access to more than 170 different device/OS/browser combinations. If you have browser tests that use Selenium, using Sauce Labs to run the tests is very easy. First, you need to sign up for their service (it's free for open source projects)."
4 Continuous Deployment
- Travis will deploy the server to AWS deploy to S3
- Live data will be in Amazon
5 Deploying on Amazon Web Services
Initially the deploy target will be AWS. http://broadbandtogether.com is the instance that Travis will deploy to.
Eventually, it may well be that the City of Seattle will deploy the code on some infrastucture of their own. Perhaps that is simply their AWS account. This is actually a good thing as one of the goals is to have liberally licensed code that can be easily deploy in multiple contexts. So, let us call this beta testing.
- Code for Seattle has a DigitalOcean account it seems. Tigue just went ahead and used AWS.
- all app statics should go on Amazon's CDN
- CI/CD on Travis and Sauce
6 Deploy destination independent info
Various issues need to be addressed whereever the code is deployed.
- Supervisor, healthcheck, etc
- Operating Node.js in Production
- Forever, Supervisor, reverse proxy, load balancing
- Ten Common Mistakes in Node.js Development | Toptal
- #1: auto restart/watch and auto reload
- #10 supervisors: pm2, forever, nodemon, supervisor
- Operating Node.js in Production
- Set up as a service
- service seanetmap start|stop|restart
- https://www.digitalocean.com/community/tutorials/how-to-install-and-run-a-node-js-app-on-centos-6-4-64bit
- "I wouldn't advise using screen for long running processes of any kind (not just node). Check node-linux at https://github.com/coreybutler/node-linux (FD: I'm the author). It will generate an init.d script allowing your node process to be managed by the OS (like other daemons). For example, `service my-node-app start|stop|restart`.
- Logging in app is via Bunyan which is storing info via DTrace