Repository: calcite Updated Branches: refs/heads/master 6fe55e3ec -> cb5d9bae8
Add option to use docker to build the website Project: http://git-wip-us.apache.org/repos/asf/calcite/repo Commit: http://git-wip-us.apache.org/repos/asf/calcite/commit/cb5d9bae Tree: http://git-wip-us.apache.org/repos/asf/calcite/tree/cb5d9bae Diff: http://git-wip-us.apache.org/repos/asf/calcite/diff/cb5d9bae Branch: refs/heads/master Commit: cb5d9bae8da970a9aca2f998c7a4445baf62254d Parents: 6fe55e3 Author: Francis Chuang <francischu...@apache.org> Authored: Wed Apr 25 14:26:24 2018 +1000 Committer: francis Chuang <francischu...@apache.org> Committed: Tue May 29 19:04:09 2018 +1000 ---------------------------------------------------------------------- site/.gitignore | 1 + site/Gemfile | 8 ++++++-- site/README.md | 41 +++++++++++++++++++++++++++++++++++------ site/docker-compose.yml | 38 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/calcite/blob/cb5d9bae/site/.gitignore ---------------------------------------------------------------------- diff --git a/site/.gitignore b/site/.gitignore index 09c86a2..aa7624f 100644 --- a/site/.gitignore +++ b/site/.gitignore @@ -1,2 +1,3 @@ .sass-cache Gemfile.lock +.jekyll-metadata \ No newline at end of file http://git-wip-us.apache.org/repos/asf/calcite/blob/cb5d9bae/site/Gemfile ---------------------------------------------------------------------- diff --git a/site/Gemfile b/site/Gemfile index cbd9d22..f06f885 100644 --- a/site/Gemfile +++ b/site/Gemfile @@ -14,8 +14,12 @@ # limitations under the License. # source 'https://rubygems.org' -gem 'github-pages', '150' +gem 'github-pages', '182' gem 'rouge' -gem 'jekyll_oembed' gem 'jekyll-redirect-from' + +group :jekyll_plugins do + gem 'jekyll_oembed' +end + # End Gemfile http://git-wip-us.apache.org/repos/asf/calcite/blob/cb5d9bae/site/README.md ---------------------------------------------------------------------- diff --git a/site/README.md b/site/README.md index 07df61f..4b5a108 100644 --- a/site/README.md +++ b/site/README.md @@ -22,24 +22,28 @@ limitations under the License. This directory contains the code for the Apache Calcite web site, [calcite.apache.org](https://calcite.apache.org/). -## Setup +You can build the site manually using your environment or use the docker compose file. -Site generation currently works best with ruby-2.4.1. +## Manually + +### Setup your environment + +Site generation currently works best with ruby-2.5.1. 1. `cd site` 2. `svn co https://svn.apache.org/repos/asf/calcite/site target` -3. `sudo apt-get install rubygems ruby2.1-dev zlib1g-dev` (linux) -4. `sudo gem install bundler github-pages jekyll jekyll-oembed` +3. `sudo apt-get install rubygems ruby2.5-dev zlib1g-dev` (linux) +4. `sudo gem install bundler` 5. `bundle install` -## Add javadoc +### Add javadoc 1. `cd ..` 2. `mvn -DskipTests site` 3. `rm -rf site/target/apidocs site/target/testapidocs` 4. `mv target/site/apidocs target/site/testapidocs site/target` -## Running locally +### Running locally Before opening a pull request, you can preview your contributions by running from within the directory: @@ -47,6 +51,31 @@ running from within the directory: 1. `bundle exec jekyll serve` 2. Open [http://localhost:4000](http://localhost:4000) +## Using docker + +### Setup your environment + +1. Install [docker](https://docs.docker.com/install/) +2. Install [docker-compose](https://docs.docker.com/compose/install/) + +### Build site +1. `cd site` +2. `docker-compose run build-site` + +### Generate javadoc +1. `cd site` +2. `docker-compose run generate-javadoc` + +### Running development mode locally +You can preview your work while working on the site. + +1. `cd site` +2. `docker-compose run --service-ports dev` + +The web server will be started on [http://localhost:4000](http://localhost:4000) + +As you make changes to the site, the site will automatically rebuild. + ## Pushing to site 1. `cd site` http://git-wip-us.apache.org/repos/asf/calcite/blob/cb5d9bae/site/docker-compose.yml ---------------------------------------------------------------------- diff --git a/site/docker-compose.yml b/site/docker-compose.yml new file mode 100644 index 0000000..2827861 --- /dev/null +++ b/site/docker-compose.yml @@ -0,0 +1,38 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to you under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +version: '3' +services: + dev: + image: jekyll/jekyll:3 + command: jekyll serve --watch --force_polling + ports: + - 4000:4000 + volumes: + - .:/srv/jekyll + build-site: + image: jekyll/jekyll:3 + command: jekyll build + volumes: + - .:/srv/jekyll + generate-javadoc: + image: maven:alpine + working_dir: /usr/src/calcite + command: sh -c "mvn -DskipTests site; rm -rf site/target/apidocs site/target/testapidocs; mkdir -p site/target; mv target/site/apidocs target/site/testapidocs site/target" + volumes: + - ../:/usr/src/calcite + - maven-repo:/root/.m2 +volumes: + maven-repo: \ No newline at end of file