GIT deploy your static sites - Part 1
When you, in principal, like the idea to serve SPA from the http server, you will encounter the pressing question:
On Bluemix that's easy: just use a Pipeline.
For mere mortal environments there are several options:
- Just FTP them - insecure unless you use sftp/scp. Big pain here: deleting obsolete files
- Setup rsync. When done with a ssh certificate can be reasonably automated. Same pain applies: deleting obsolete files
- Use a GIT based deployment. This is what I will discuss further
- The repositories would sit on the web server
- Typically a repository would sit in
.gitinside the site directory. While you could protect that with access control, I decided I don't want to have it in separate directories
- When pushing to the
masterbranch, the site should get updated, not on any other branch. You can extend my approach to push other branches to other sites - so you get a test/demo/staging capability
- Setting up a new site should be fast and reliable (including https - but that's part 2)
post-receive. Hooks, in a nutshell are shell scripts that are triggered by events that happen to a git environment. I got inspired by this entry but wanted to automate the setup.