A new server-stability measure

I’ve updated the invoke deploy.production.quick task so that, before bringing down and restarting the server, it first runs a test server on a separate port using the new state of the repository. It attempts to retrieve a number of pages from that test server - at the moment ‘/’, ‘/dn’, ‘/dn1’ and ‘/en/dn1’, representing the vast majority of pages users will see (home, division, details and text). If there is an exception causing the server to completely fail to start, or if any of those pages return anything other than a HTTP 200 response, the invoke task aborts with a mean error message the essence of which is “Though shalt not pass”. Only if the green light is received from the test server is the real server then restarted. Otherwise the production server continues running the old code & assets.

You can also run this as a local invoke task in your development environment:
invoke test_server
It simply starts a server on a different port, downloads those 4 pages and then quits with a nice green message if everything is cool, or a mean red message if stuff is broken.

Note that this feature does not guarantee that there are no serious problems with the checked in code! But, it should catch the vast majority of problems.

1 Like