Allows a quick deployment of jekyll generated websites
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
LICENSE
README.md
deploy_jekyll.sh

README.md

deploy_jekyll

Allows a quick deployment of jekyll generated websites

Prerequisites

  • bash, version 4+
  • rsync

How to use it?

You have to edit the script to change the distant_folders hash, which contains a list of two parameters for each distant site:

  • the url of the website
  • the destination folder of the website

For example, if you have 2 websites, and want to deploy in these folders:

  • site1.com: /var/www/mainsite/
  • site2.com: /var/www/backup/

Then you have to edit the script like this:

distant_folders=( ['site1.com']='/var/www/mainsite/' ['site2.com']='/var/www/backup/' )

Don't forget to change the rights on the file: sudo chmod 777 deploy_jekyll.sh 777 is not too strong, as you may want to add this script to your commits and allow fellow contributors to execute and edit it.

How does it work?

  • The script checks if you configured a special folder in the build process, the default folder being _site.
  • Then, it synchronizes this folder with the folders of your real websites, using rsync.
  • If rsync doesn't work for some reason, you get an error message and the reason why it didn't work.

Why should I use this script and not my git/gulp routine?

  1. You may not want to deploy your website everytime you commit. Sometimes you commit just to save your changes, and you don't want the user to see them.
  2. You may also do not want to have to commit in order to deploy. Sometimes, you deploy what you already have, for example on new servers or on an existing server that you have changed.
  3. The method described on Jekyll website sure works, but you must have installed Jekyll on your distant server, push all the changes of the source, and build the whole site again (what you've already done on your computer).
  4. Sometimes, you may not be allowed to install git or jekyll on the remote server, whereas rsync is pretty common, from my experience.
  5. Because everybody uses the git method, so let's be original and find another one.

FAQ

Nothing for the moment, everything works fine for me and I didn't receive any feedback yet!