use docker build document Signed-off-by: shaofengshi <shaofeng...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/2829730a Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/2829730a Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/2829730a Branch: refs/heads/document Commit: 2829730ac7971fd5657e114eb936b45fff685749 Parents: 003769b Author: YongjieZhao <yongjie.z...@gmail.com> Authored: Mon Dec 4 16:38:46 2017 +0800 Committer: shaofengshi <shaofeng...@apache.org> Committed: Tue Dec 5 14:24:38 2017 +0800 ---------------------------------------------------------------------- website/Dockerfile | 3 +++ website/Makefile | 13 +++++++++++++ website/_dev/howto_docs.md | 31 ++++++++++++++++++++++++++++++- 3 files changed, 46 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/2829730a/website/Dockerfile ---------------------------------------------------------------------- diff --git a/website/Dockerfile b/website/Dockerfile new file mode 100644 index 0000000..e58d0e4 --- /dev/null +++ b/website/Dockerfile @@ -0,0 +1,3 @@ +FROM jekyll/jekyll:2.5.3 + +RUN gem install jekyll-multiple-languages:1.0.11 kramdown rouge http://git-wip-us.apache.org/repos/asf/kylin/blob/2829730a/website/Makefile ---------------------------------------------------------------------- diff --git a/website/Makefile b/website/Makefile new file mode 100644 index 0000000..1b59583 --- /dev/null +++ b/website/Makefile @@ -0,0 +1,13 @@ +#!/bin/bash + +docker.build: + docker build -f Dockerfile -t kylin-document:latest . + +document.build: + docker run --volume="$(shell pwd):/srv/jekyll" --rm -it kylin-document:latest jekyll build + +runserver: + docker run --volume="$(shell pwd):/srv/jekyll" -p 4000:4000 --rm -it kylin-document:latest jekyll server --watch + +clean: + rm -rf _site http://git-wip-us.apache.org/repos/asf/kylin/blob/2829730a/website/_dev/howto_docs.md ---------------------------------------------------------------------- diff --git a/website/_dev/howto_docs.md b/website/_dev/howto_docs.md index a20cd17..8867b59 100644 --- a/website/_dev/howto_docs.md +++ b/website/_dev/howto_docs.md @@ -20,7 +20,7 @@ Install following tools before you add or edit documentation: * `gem install jekyll jekyll-multiple-languages kramdown rouge` * __Note__: Some specific version of jekyll and jekyll-multiple-languages does not work together (I got a "undefined method" error with jekyll 3.0.1 and jekyll-multiple-languages 2.0.3). In that case, `jekyll 2.5.3` and `jekyll-multiple-languages 1.0.8` is the known working version. * eg. Use `gem install jekyll --version "=2.5.3"` to install a specific version. - + * __Note__: For Mac user, if gem install raise error like this 'ERROR: While executing gem ... (Gem::FilePermissionError)'. To solve this problem you can use 'brew install ruby', then restart you terminal. 3. And optionally any markdown editor you prefer Below is a gem list that works. Stick to these versions if jekyll installation becomes a problem. @@ -43,6 +43,35 @@ rouge (1.10.1) ... ``` +## Use Docker for document compile + +The latest kylin release provides dockerfile, to reduce build complexity using docker and Makefile can call docker command. + +``` +$ pwd +/Users/<username>/kylin/website +$ make docker.build +docker build -f Dockerfile -t kylin-document:latest . +Sending build context to Docker daemon 82.44MB +Step 1/3 : FROM jekyll/jekyll:2.5.3 + ---> e81842c29599 +Step 2/3 : RUN gem install jekyll-multiple-languages -v 1.0.11 + ---> Using cache + ---> e9e8b0f1d388 +Step 3/3 : RUN gem install rouge -v 3.0.0 + ---> Using cache + ---> 1bd42c6b93c0 +Successfully built 1bd42c6b93c0 +Successfully tagged kylin-document:latest +$ make runserver +docker run --volume="/Users/<username>/kylin/website:/srv/jekyll" -p 4000:4000 --rm -it kylin-document:latest jekyll server --watch +Configuration file: /srv/jekyll/_config.yml + Source: /srv/jekyll + Destination: /srv/jekyll/_site + Generating... +... +``` + ## About Jekyll Jekyll is a Ruby script to generate a static HTML website from source text and themes, the HTML is generated before being deployed to the web server. Jekyll also happens to be the engine behind GitHub Pages.