Skip to content

Commit 074b3b8

Browse files
committed
Add docker for website generation
1 parent 34b836b commit 074b3b8

File tree

6 files changed

+113
-0
lines changed

6 files changed

+113
-0
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,5 @@ compiler/test-coursier/run/*.jar
9393
# docs related
9494
contributors.js
9595
content-contributors.css
96+
docs/_spec/_site/
97+
docs/_spec/.jekyll-metadata

Diff for: docs/_spec/Dockerfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM ruby:2.7
2+
3+
RUN apt-get install -y curl \
4+
&& curl -sL https://deb.nodesource.com/setup_18.x | bash - \
5+
&& apt-get install -y nodejs \
6+
&& curl -L https://www.npmjs.com/install.sh | sh
7+
8+
RUN gem install bundler:1.17.2 jekyll
9+
10+
WORKDIR /srv/jekyll
11+
12+
COPY Gemfile .
13+
COPY Gemfile.lock .
14+
15+
16+
RUN echo -n "bundle version: " && bundle --version
17+
RUN bundle install
18+
RUN mkdir /opt/npm-global
19+
RUN npm config set prefix '/opt/npm-global'
20+
RUN npm config set global true
21+
RUN npm install bower
22+
RUN echo -n "npm version: " && npm --version
23+
RUN chmod u+s /bin/chown
24+
RUN date

Diff for: docs/_spec/Gemfile

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# To build the spec on Travis CI
2+
source "https://rubygems.org"
3+
4+
gem "jekyll", "3.6.3"
5+
gem "webrick"
6+
gem "rouge"
7+
# gem 's3_website'
8+
gem "redcarpet", "3.5.1"

Diff for: docs/_spec/Gemfile.lock

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
addressable (2.8.1)
5+
public_suffix (>= 2.0.2, < 6.0)
6+
colorator (1.1.0)
7+
ffi (1.15.5)
8+
forwardable-extended (2.6.0)
9+
jekyll (3.6.3)
10+
addressable (~> 2.4)
11+
colorator (~> 1.0)
12+
jekyll-sass-converter (~> 1.0)
13+
jekyll-watch (~> 1.1)
14+
kramdown (~> 1.14)
15+
liquid (~> 4.0)
16+
mercenary (~> 0.3.3)
17+
pathutil (~> 0.9)
18+
rouge (>= 1.7, < 3)
19+
safe_yaml (~> 1.0)
20+
jekyll-sass-converter (1.5.2)
21+
sass (~> 3.4)
22+
jekyll-watch (1.5.1)
23+
listen (~> 3.0)
24+
kramdown (1.17.0)
25+
liquid (4.0.3)
26+
listen (3.7.1)
27+
rb-fsevent (~> 0.10, >= 0.10.3)
28+
rb-inotify (~> 0.9, >= 0.9.10)
29+
mercenary (0.3.6)
30+
pathutil (0.16.2)
31+
forwardable-extended (~> 2.6)
32+
public_suffix (5.0.0)
33+
rb-fsevent (0.11.2)
34+
rb-inotify (0.10.1)
35+
ffi (~> 1.0)
36+
redcarpet (3.5.1)
37+
rouge (2.2.1)
38+
safe_yaml (1.0.5)
39+
sass (3.7.4)
40+
sass-listen (~> 4.0.0)
41+
sass-listen (4.0.0)
42+
rb-fsevent (~> 0.9, >= 0.9.4)
43+
rb-inotify (~> 0.9, >= 0.9.7)
44+
webrick (1.7.0)
45+
46+
PLATFORMS
47+
ruby
48+
x86_64-linux
49+
50+
DEPENDENCIES
51+
jekyll (= 3.6.3)
52+
redcarpet (= 3.5.1)
53+
rouge
54+
webrick
55+
56+
BUNDLED WITH
57+
2.3.5

Diff for: docs/_spec/README.md

+11
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,22 @@ We aim to track the configuration GitHub Pages uses but differences may arise as
1616

1717
## Building
1818

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

22+
<!-- TODO: Check nothing else is needed -->
23+
To preview locally, run the following commands in the docs/_spec subfolder:
24+
25+
```
26+
env UID="$(id -u)" GID="$(id -g)" docker-compose up
27+
```
28+
29+
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`.
30+
<!--
2131
To preview locally, run the following commands in the root of your checkout scala/scala:
2232
`bundle install` to install Jekyll and `bundle exec jekyll serve -d build/spec/ -s spec/ -w --baseurl=""` to start it,
2333
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`.
34+
-->
2435

2536
## General Advice for editors
2637

Diff for: docs/_spec/docker-compose.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: '2'
2+
3+
services:
4+
jekyll:
5+
user: "${UID}:${GID}"
6+
build: .
7+
command: sh -c "chown $UID / && bundle exec jekyll serve --incremental --host=0.0.0.0 "
8+
ports:
9+
- '4000:4000'
10+
volumes:
11+
- .:/srv/jekyll

0 commit comments

Comments
 (0)