Skip to content

Commit

Permalink
gh-pages: add Dockerfile for local dev/testing (#3201)
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Ralphson <[email protected]>
  • Loading branch information
MikeRalphson authored Mar 18, 2023
1 parent 003ee43 commit 1232ed6
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_site/
deploy/
node_modules/
scripts/
package-lock.json
43 changes: 43 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Contributing

## Building the site

The registy site uses [jekyll](https://jekyllrb.com/), a Ruby based static site generator, with the Dinky theme.

### Docker dev

You can use the following Docker command to build and serve the site:

```shell
docker build . -t oas-spec/latest
docker run -v $(pwd):/site -p 4000:4000 oas-spec/latest
```

### Local Ruby dev

You will need to set up Ruby locally to run the server and see your changes.

``` bash
gem install bundler
bundle install
```

With all the gems (dependencies) installed, you can launch the jekyll server.

``` bash
bundle exec jekyll serve
```

It will show output like this, and you can grab the Server address and open it in your browser.

```
Configuration file: /site/_config.yml
Source: /site
Destination: /site/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 3.609 seconds.
Auto-regeneration: enabled for '/site'
Server address: http://0.0.0.0:4000
```

13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM bretfisher/jekyll-serve

WORKDIR /site

# install dependencies
COPY Gemfile Gemfile.lock .
RUN bundle install

# install the site
COPY . .

EXPOSE 4000
CMD [ "bundle", "exec", "jekyll", "serve", "--host", "0.0.0.0" ]
12 changes: 12 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

source "https://rubygems.org"

gem "jekyll", "~> 4.2"
gem "webrick", "~> 1.7"
gem "jekyll-remote-theme"
gem "jekyll-theme-dinky"

group :jekyll_plugins do
gem "jekyll-sitemap", "~> 1.4"
end
87 changes: 87 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.8.1)
public_suffix (>= 2.0.2, < 6.0)
colorator (1.1.0)
concurrent-ruby (1.2.2)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.15.5)
forwardable-extended (2.6.0)
google-protobuf (3.22.2-x86_64-linux)
http_parser.rb (0.8.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jekyll (4.3.2)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-remote-theme (0.4.3)
addressable (~> 2.0)
jekyll (>= 3.5, < 5.0)
jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
rubyzip (>= 1.3.0, < 3.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-theme-dinky (0.2.0)
jekyll (> 3.5, < 5.0)
jekyll-seo-tag (~> 2.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (5.0.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rexml (3.2.5)
rouge (4.1.0)
rubyzip (2.3.2)
safe_yaml (1.0.5)
sass-embedded (1.59.2-x86_64-linux-gnu)
google-protobuf (~> 3.21)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.4.2)
webrick (1.8.1)

PLATFORMS
x86_64-linux

DEPENDENCIES
jekyll (~> 4.2)
jekyll-remote-theme
jekyll-sitemap (~> 1.4)
jekyll-theme-dinky
webrick (~> 1.7)

BUNDLED WITH
2.4.7
3 changes: 2 additions & 1 deletion index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
title: OpenAPI Initiative gh-pages repository
description: HTML Spec. and extensible registry
layout: default
---
# OpenAPI Initiative Registry

Expand All @@ -13,4 +14,4 @@ This site contains the OpenAPI Initiative Registry and content for the HTML vers
## The Specification

* [Markdown source-of-truth](https://github.com/OAI/OpenAPI-Specification)
* [HTML Specification version](oas/v3.1.0.html)
* [HTML Specification version](oas/latest.html)
2 changes: 1 addition & 1 deletion registry/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Please raise a [Pull-Request](https://github.com/OAI/OpenAPI-Specification/pulls

#### API access

* [registries.json](./api/registries.json) - Registries meta-registry
* [registries.json](../api/registries.json) - Registries meta-registry
{% for registry in site.collections %}{% unless registry.hidden %}* <a href="../api/{{ registry.slug }}.json">{{ registry.slug }}.json</a>{% endunless %}
{% endfor %}

Expand Down

0 comments on commit 1232ed6

Please sign in to comment.