Deploying to ep.io with secret stuff
Published: mars 27, 2011
A while ago I got an invite to ep.io, a new kind of Heroku-inspired hosting for WSGI-compatible framework (like Django, Flask etc). And since I really can't get easy_install to work properly with my current host I decided to give ep.io a chance.
Deploying to ep.io is quite easy, if you are running linux/mac that is, when under Windows it's a whole different task (something I will come back to). One of the first thing I noticed was that you have to have all the stuff commited to a git-repo, and since I'm using a github-repo this was no biggie, but, there are some things you don't want to commit to your public git-repo, like API-keys etc. A common solution for Django is to have a file called local_settings.py that is never checked in (and added to your .gitignore) so you add your secret stuff for everyplace you deploy your code. And ep.io don't have a solution for this problem. I asked a question and got some good answers, but all a bit overkill for me. So this is how I solved it.
- A folder that is added to .gitignore
- The folder (called deploy for me) contains a deploy-script, and two folders, on called input and one called output.
- The input-folder contains all the secret files
- The output-folder is there as build-folder
- Commit and push your code
- Run deploy\deploy.bat (yeah, I'm on Windows)
What the deploy-script does
- Empties the output-folder
- Clones the git-repo
- Copies the files from input to the output-folder
- Runs some git-commands to add and commit
- Adds ep.io as remote
- Pushes to ep.io
If you want my deploy-script please download it, and if you got any suggestions, please leave a comment=)