Skip to content

07. Working with the web site

Ilkka Seppälä edited this page Aug 11, 2016 · 8 revisions

General

The project web site is built with Jekyll, a static web site generator. The source code is in the gh-pages branch.

Jekyll quick start

  1. Install Ruby Linux instructions Windows instructions
  2. Install Jekyll, see instructions
  3. Install additional gems gem install jekyll-sitemap gem install s3_website gem install html-proofer
  4. Clone the repository and switch to gh-pages branch
  5. Init and update the submodule, see commands in update-ghpages.sh
  6. In the repository's main directory run jekyll build
  7. Test the site locally by running jekyll serve

Automatic updating / buildchain

We use a quite complex automagic build chain in order to guarantee that any change in either the master or the gh-pages branch gets deployed ASAP.

This buildchain does take a long time though! Especially the travis build of master can take up to 20 minutes!

The build chain looks something like this (each point triggers the one below itself):

  • commit in master
  • travis build of master
  • update-ghpages.sh (via after_success: bash update-ghpages.sh in .travis.yml of master)
  • Travis-CI automagic update and commit of the git submodule to gh-pages branch
  • travis build of gh-pages branch
  • s3 deploy (via after_success: ... in .travis.yml of gh-pages)

gh-pages branch

Due to the fact that we use git submodules, the website normally wouldn't automatically update with the changes in the master branch.

To enable the automatic update of the submodule reference we use the update-ghpages.sh script in the master branch together with Travis-CI.

Travis calls the update-ghpages.sh script if the build was successfull (as seen in travis.yml Line 17)

Amazon s3 @ java-design-patterns.com

We additionally deploy our website to an Amazon s3 instance with cloudfront CDN.

This is again accomplished through the use of Travis. First of all we have our own buildscript to build and test our website. If this build and the test is successfull then we use the s3_website application to publish the website. This is done via after_success: ... in .travis.yml of gh-pages

Categories & tags

The web site patterns page displays a collection of categories and tags that can be used to select patterns based on criteria. The available categories and tags can be edited in gh-pages branch _data folder https://github.com/iluwatar/java-design-patterns/tree/gh-pages/_data

Clone this wiki locally