Skip to content

Commit

Permalink
Add docker for website generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Bernet committed Feb 6, 2023
1 parent 34b836b commit 074b3b8
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,5 @@ compiler/test-coursier/run/*.jar
# docs related
contributors.js
content-contributors.css
docs/_spec/_site/
docs/_spec/.jekyll-metadata
24 changes: 24 additions & 0 deletions docs/_spec/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ruby:2.7

RUN apt-get install -y curl \
&& curl -sL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& curl -L https://www.npmjs.com/install.sh | sh

RUN gem install bundler:1.17.2 jekyll

WORKDIR /srv/jekyll

COPY Gemfile .
COPY Gemfile.lock .


RUN echo -n "bundle version: " && bundle --version
RUN bundle install
RUN mkdir /opt/npm-global
RUN npm config set prefix '/opt/npm-global'
RUN npm config set global true
RUN npm install bower
RUN echo -n "npm version: " && npm --version
RUN chmod u+s /bin/chown
RUN date
8 changes: 8 additions & 0 deletions docs/_spec/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# To build the spec on Travis CI
source "https://rubygems.org"

gem "jekyll", "3.6.3"
gem "webrick"
gem "rouge"
# gem 's3_website'
gem "redcarpet", "3.5.1"
57 changes: 57 additions & 0 deletions docs/_spec/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
colorator (1.1.0)
ffi (1.15.5)
forwardable-extended (2.6.0)
jekyll (3.6.3)
addressable (~> 2.4)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.14)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (>= 1.7, < 3)
safe_yaml (~> 1.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-watch (1.5.1)
listen (~> 3.0)
kramdown (1.17.0)
liquid (4.0.3)
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.0)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
redcarpet (3.5.1)
rouge (2.2.1)
safe_yaml (1.0.5)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
webrick (1.7.0)

PLATFORMS
ruby
x86_64-linux

DEPENDENCIES
jekyll (= 3.6.3)
redcarpet (= 3.5.1)
rouge
webrick

BUNDLED WITH
2.3.5
11 changes: 11 additions & 0 deletions docs/_spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,22 @@ We aim to track the configuration GitHub Pages uses but differences may arise as

## Building

<!-- TODO: change url to correct one -->
Travis CI builds the spec automatically after every merged pull release and publishes to https://www.scala-lang.org/files/archive/spec/2.13/.

<!-- TODO: Check nothing else is needed -->
To preview locally, run the following commands in the docs/_spec subfolder:

```
env UID="$(id -u)" GID="$(id -g)" docker-compose up
```

and open http://0.0.0.0:4000/files/archive/spec/2.13/ to view the spec. Jekyll will rebuild as you edit the markdown, but make sure to restart it when you change `_config.yml`.
<!--
To preview locally, run the following commands in the root of your checkout scala/scala:
`bundle install` to install Jekyll and `bundle exec jekyll serve -d build/spec/ -s spec/ -w --baseurl=""` to start it,
and open http://0.0.0.0:4000/ to view the spec. Jekyll will rebuild as you edit the markdown, but make sure to restart it when you change `_config.yml`.
-->

## General Advice for editors

Expand Down
11 changes: 11 additions & 0 deletions docs/_spec/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '2'

services:
jekyll:
user: "${UID}:${GID}"
build: .
command: sh -c "chown $UID / && bundle exec jekyll serve --incremental --host=0.0.0.0 "
ports:
- '4000:4000'
volumes:
- .:/srv/jekyll

0 comments on commit 074b3b8

Please sign in to comment.