Git scm offers a very interesting technique, called hooks. A hook is basically a trigger which is fired after the specific event occurs. If you create a new git repository with git init
the folder .git/hooks with a couple of sample shell scripts is created. I personally use a hook to automate the deployment process of this website. After a commit is made, I automatically run a jekyll build
and then copy the newly created site to the server.
My current post-commit script looks like the following, simple but effective:
#!/bin/bash
jekyll build
scp -r _site/* user@host:/home/user/html/
rsync
. Now the scripts looks as follows:
#!/bin/bash
jekyll build
rsync --update --progress -r _site/* user@host:/home/user/html/
Today, I’m trying out how to build this website with jekyll. With jekyll one can easily write markdown and yml files and create static pages from it. The advantages are obvious. No problems with scripts and security issues since all the files are HTML5, CSS and only a bit of Javascript. Also there is no need for complex server configuration or any high server speed. A simple webspace with FTP or SSH access is enough.
Previous Page: 28 of 28 Next