Update to include docker files for building Gerrit website
This change adds three files. With these files, Gerrit users
(with appropriate permissions) can build the new Jekyll-based
Gerrit website. These files require that you install:
* docker
* docker-compose
With those tools installed, build the site using the following command
from the jekyll-source directory:
docker-compose up
The generated files appear in the jekyll-source/_site directory.
In addition to these changes, I fixed a minor issue with some index.md
files.
Change-Id: I9137880b51ee5282267f0c6f29cbb3c539822cae
diff --git a/jekyll-source/Dockerfile b/jekyll-source/Dockerfile
index 0998d0e..d04d73b 100644
--- a/jekyll-source/Dockerfile
+++ b/jekyll-source/Dockerfile
@@ -1,25 +1,19 @@
-FROM ruby:2.1
-MAINTAINER mrafayaleem@gmail.com
+FROM ruby:2.4-alpine
-RUN apt-get clean \
- && mv /var/lib/apt/lists /var/lib/apt/lists.broke \
- && mkdir -p /var/lib/apt/lists/partial
+RUN apk add --no-cache build-base gcc bash cmake
-RUN apt-get update
+RUN gem install jekyll
-RUN apt-get install -y \
- node \
- python-pygments \
- && apt-get clean \
- && rm -rf /var/lib/apt/lists/
-
-WORKDIR /tmp
-ADD Gemfile /tmp/
-ADD Gemfile.lock /tmp/
-RUN bundle install
-
-VOLUME /src
EXPOSE 4000
-WORKDIR /src
-ENTRYPOINT ["jekyll", "serve", "-H", "0.0.0.0"]
\ No newline at end of file
+WORKDIR /site
+
+# create new site by setting -e JEKYLL_NEW=true
+ENV JEKYLL_NEW false
+
+COPY docker-entrypoint.sh /usr/local/bin/
+
+# on every container start we'l'
+ENTRYPOINT [ "docker-entrypoint.sh" ]
+
+CMD [ "bundle", "exec", "jekyll", "serve", "--force_polling", "-H", "0.0.0.0", "-P", "4000" ]
diff --git a/jekyll-source/docker-compose.yml b/jekyll-source/docker-compose.yml
index f372ae6..ba1e36e 100644
--- a/jekyll-source/docker-compose.yml
+++ b/jekyll-source/docker-compose.yml
@@ -1,11 +1,8 @@
version: '2'
services:
server:
- build:
- context: .
- dockerfile: Dockerfile
- image: result/latest
+ image: bretfisher/jekyll-serve
ports:
- - "4000:4000"
+ - "4000:4000"
volumes:
- - ".:/src"
\ No newline at end of file
+ - ".:/site"
diff --git a/jekyll-source/docker-entrypoint.sh b/jekyll-source/docker-entrypoint.sh
new file mode 100644
index 0000000..962edec
--- /dev/null
+++ b/jekyll-source/docker-entrypoint.sh
@@ -0,0 +1,25 @@
+#!/bin/bash
+set -e
+
+#cd /site
+
+
+if [ "$JEKYLL_NEW" = true ]; then
+ echo "NOTE: making new jekyll site!"
+ jekyll new .
+fi
+
+if [ ! -f Gemfile ]; then
+ echo "NOTE: hmm, I don't see a Gemfile so I don't think there's a jekyll site here"
+ echo "Either you didn't mount a volume, or you mounted it incorrectly."
+ echo "be sure you're in your jekyll site root and use something like this to launch"
+ echo ""
+ echo "docker run -p 80:4000 -v \$(pwd):/site bretfisher/jekyll-serve"
+ echo ""
+ echo "NOTE: To create a new site, add '-e JEKYLL_NEW=true' to the above command"
+ exit 1
+fi
+
+bundle install
+
+exec "$@"
diff --git a/jekyll-source/pages/gerrit/doc-index.html b/jekyll-source/pages/gerrit/doc-index.html
index 3a36447..850c775 100644
--- a/jekyll-source/pages/gerrit/doc-index.html
+++ b/jekyll-source/pages/gerrit/doc-index.html
@@ -3,7 +3,7 @@
keywords: gerrit
sidebar: gerritdoc_sidebar
toc: false
-permalink: doc-index.html
+permalink: index.html
folder: gerrit
---
<!-- Service List -->
diff --git a/jekyll-source/pages/gerrit/index.md b/jekyll-source/pages/gerrit/index.md
deleted file mode 100644
index 070dda0..0000000
--- a/jekyll-source/pages/gerrit/index.md
+++ /dev/null
@@ -1,202 +0,0 @@
----
-title: " Gerrit Code Review for Git"
-sidebar: gerritdoc_sidebar
-permalink: index.html
----
-## Quickstarts
-
-1. [Quickstart for Installing Gerrit on Linux](linux-quickstart.html)
-
-## About Gerrit
-
-1. [Product Overview](intro-quick.html)
-
-2. [How Gerrit Works](intro-how-gerrit-works.html)
-
-3. [Basic Gerrit Walkthrough](intro-gerrit-walkthrough.html)
-
-## Guides
-
-1. [User Guide](intro-user.html)
-
-2. [Project Owner Guide](intro-project-owner.html)
-
-3. [Default Android
- Workflow](https://source.android.com/source/developing) (external)
-
-## Tutorials
-
-1. Web
-
- 1. [Reviewing Changes](user-review-ui.html)
-
- 2. [Searching Changes](user-search.html)
-
- 3. [Manipulating Changes in Browser](user-inline-edit.html)
-
- 4. [Subscribing to Email Notifications](user-notify.html)
-
-2. SSH
-
- 1. [SSH connection details](user-upload.html#ssh)
-
- 2. [Command Line Tools](cmd-index.html)
-
-3. Git
-
- 1. Commands, scenarios
-
- 1. [Uploading Changes](user-upload.html)
-
- 2. [Error Messages](error-messages.html)
-
- 2. Changes
-
- 1. [Change-Id Lines](user-changeid.html)
-
- 2. [Signed-off-by Lines](user-signedoffby.html)
-
- 3. [Change Cleanup](user-change-cleanup.html)
-
-## Project Management
-
-1. [Project Configuration](project-configuration.html)
-
- 1. [Review Labels](config-labels.html)
-
- 2. [Project Configuration File Format](config-project-config.html)
-
-2. [Access Controls](access-control.html)
-
-3. Multi-project management
-
- 1. [Submodules](user-submodules.html)
-
- 2. [Repo](https://source.android.com/source/using-repo.html)
- (external)
-
-4. Prolog rules
-
- 1. [Prolog Cookbook](prolog-cookbook.html)
-
- 2. [Prolog Facts for Gerrit Changes](prolog-change-facts.html)
-
-5. [Project deletion](intro-project-owner.html#project-deletion)
-
-## Customization and Integration
-
-1. [Dashboards](user-dashboards.html)
-
-2. [REST API](rest-api.html)
-
-3. [Gitweb Integration](config-gitweb.html)
-
-4. [Themes](config-themes.html)
-
-5. [Single Sign-On Systems](config-sso.html)
-
-6. [Hooks](config-hooks.html)
-
-7. [Mail Templates](config-mail.html)
-
-8. [Contributor Agreements](config-cla.html)
-
-9. [Robot Comments](config-robot-comments.html)
-
-## Server Administration
-
-1. [Installation Guide](install.html)
-
-2. [System Settings](config-gerrit.html)
-
-3. [Command Line Tools](cmd-index.html)
-
-4. [Replication](config-plugins.html#replication)
-
-5. [Plugins](config-plugins.html)
-
-6. [Metrics](metrics.html)
-
-7. [Reverse Proxy](config-reverseproxy.html)
-
-8. [Automatic Site Initialization on
- Startup](config-auto-site-initialization.html)
-
-9. [Server Side Administrative Tools](pgm-index.html)
-
-10. [NoteDb](note-db.html)
-
-11. [Accounts](config-accounts.html)
-
-## Developer
-
-1. Getting Started
-
- 1. [Developer Setup](dev-readme.html)
-
- 2. [Building with Bazel](dev-bazel.html)
-
- 3. [Eclipse Setup](dev-eclipse.html)
-
- 4. [IntelliJ Setup](dev-intellij.html)
-
- 5. [Contributing to Gerrit](dev-contributing.html)
-
-2. Plugin Development
-
- 1. [Developing Plugins](dev-plugins.html)
-
- 2. [Building Gerrit plugins](dev-build-plugins.html)
-
- 3. [JavaScript Plugin API](js-api.html)
-
- 4. [Validation Interfaces](config-validation.html)
-
- 5. [Starring Changes](dev-stars.html)
-
-3. [System Design](dev-design.html)
-
-4. [i18n Support](i18n-readme.html)
-
-## Maintainer
-
-1. [Making a Gerrit Release](dev-release.html)
-
-2. [Making a Release of a Gerrit
- Subproject](dev-release-subproject.html)
-
-3. [Making a Release of JGit](dev-release-jgit.html)
-
-## Concepts
-
-1. [Review Labels](config-labels.html)
-
-2. [Access Controls](access-control.html)
-
-3. [Changes](concept-changes.html)
-
-4. [The refs/for Namespace](concept-refs-for-namespace.html)
-
-5. [Patch Sets](concept-patch-sets.html)
-
-## Resources
-
- - [Licenses and Notices](licenses.html)
-
- - [Homepage](https://www.gerritcodereview.com/)
-
- - [Downloads](https://www.gerritcodereview.com/download/index.html)
-
- - [Issue Tracking](https://bugs.chromium.org/p/gerrit/issues/list)
-
- - [Source Code](https://gerrit.googlesource.com/gerrit)
-
- - [A History of Gerrit Code
- Review](https://www.gerritcodereview.com/about.md)
-
-## GERRIT
-
-Part of [Gerrit Code Review](https://www.gerritcodereview.com/)
-
-## SEARCHBOX
-