After committing some changes, I've been deploying them using git push.
Then I'd check the pages. Some (the ones that require changes to Python code) would fail to update and I'd need to restart ssh into the remote repository and restart Gunicorn. (kill -HUP process_number, where process_number can be found using grep).
Then, if I was smart, I would check the different instantions of web pages to make sure that everything was in order.
Anyway, today I wrote a little script called deploy. I made it executable, put it in a folder called 'bin' in my home directory, and put it on the path by adding an export command to the bottom of bashrc.
Right now it just chains four commands using &&, so that each one only begins upon the successful completion of the last.
#!/bin/bash
cd /home/doug/workspace/nnumscom/nnums
git push live master && ssh django@[host_ip] 'kill -HUP [process_number]' && ./nopen
nopen is a script that opens a set of about 12 web pages on the remote website so that I can give everything a quick visual.
The nice thing is that now I can take this and improve on it over time. And, of course, I replace three processes (two of which I might forget) with one.
Recursive algorithms can be slow because they end up solving the same little problems over and over again. To speed them up, you can use a technique called "memoization." Memoization allows algorithms go much more quickly by remembering solutions to problems they have already solved. I’m the recursive algorithm. This blog is my memoization.
Showing posts with label deployment. Show all posts
Showing posts with label deployment. Show all posts
Monday, December 8, 2014
Better deployment
Labels:
bashrc,
deployment,
gunicorn,
linux scripting,
ssh commands
Wednesday, November 19, 2014
openshift
https://stackoverflow.com/questions/26871381/deploying-a-local-django-app-using-openshift
Subscribe to:
Posts (Atom)