Skip to content

Commit d617bdf

Browse files
committed
Create scripts and Docker Compose file for easier testing (githubtraining#21)
* Create scripts and Docker Compose file * Remove unnecessary options from _config.yml
1 parent 5255865 commit d617bdf

File tree

8 files changed

+53
-63
lines changed

8 files changed

+53
-63
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
vendor/
2+
_site/
3+
.sass-cache/
4+
.jekyll-cache/
5+
.jekyll-metadata
6+
.bundle/

Gemfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
source "https://rubygems.org"
22

3-
gem "github-pages", ">= 200"
4-
gem "minitest"
5-
gem "test-unit"
3+
gem 'github-pages', group: :jekyll_plugins

Gemfile.lock

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,22 +213,19 @@ GEM
213213
rb-fsevent (~> 0.10, >= 0.10.3)
214214
rb-inotify (~> 0.9, >= 0.9.10)
215215
mercenary (0.3.6)
216-
mini_portile2 (2.5.1)
217216
minima (2.5.1)
218217
jekyll (>= 3.5, < 5.0)
219218
jekyll-feed (~> 0.9)
220219
jekyll-seo-tag (~> 2.1)
221220
minitest (5.14.4)
222221
multipart-post (2.1.1)
223-
nokogiri (1.11.6)
224-
mini_portile2 (~> 2.5.0)
222+
nokogiri (1.11.6-x86_64-linux)
225223
racc (~> 1.4)
226224
octokit (4.21.0)
227225
faraday (>= 0.9)
228226
sawyer (~> 0.8.0, >= 0.5.3)
229227
pathutil (0.16.2)
230228
forwardable-extended (~> 2.6)
231-
power_assert (2.0.0)
232229
public_suffix (4.0.6)
233230
racc (1.5.2)
234231
rb-fsevent (0.11.0)
@@ -253,8 +250,6 @@ GEM
253250
unf (~> 0.1.4)
254251
terminal-table (1.8.0)
255252
unicode-display_width (~> 1.1, >= 1.1.1)
256-
test-unit (3.4.1)
257-
power_assert
258253
thread_safe (0.3.6)
259254
typhoeus (1.4.0)
260255
ethon (>= 0.9.0)
@@ -270,9 +265,7 @@ PLATFORMS
270265
ruby
271266

272267
DEPENDENCIES
273-
github-pages (>= 200)
274-
minitest
275-
test-unit
268+
github-pages
276269

277270
BUNDLED WITH
278-
2.2.6
271+
2.0.2

_config.yml

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,3 @@
1-
# Name of your blog (this will show up at the top of your page and in the RSS feed)
1+
# Set name to prevent title from displaying at the top of the page
2+
# https://github.com/pages-themes/primer/issues/21#issuecomment-440722302
23
name: GitHub Games
3-
4-
# Short description (goes below the title; it will also be used in the RSS feed)
5-
description: This GitHub Games has lots of tests
6-
7-
# Your name, as you want it to appear underneath each post and in the footer
8-
author: GitHub Training, but forked
9-
10-
# Your email if you want it to be linked on the contact page
11-
author_email: you@example.com
12-
13-
# The directory for category index pages. Change it to something else if
14-
# for example you want links like /categories/category1 instead of /category1
15-
category_dir: /
16-
17-
# Uncomment if you are planning to run the blog in a subdirectory
18-
# Note - if you enable this, and attempt to view your site locally you have to use the baseurl in your local path.
19-
# Example, you must use http://localhost:4000/path/to/blog
20-
#baseurl: /path/to/blog
21-
# baseurl:
22-
23-
# The URL of your actual domain. This will be used to make absolute links in the RSS feed.
24-
# url: http://yourdomain.com/
25-
26-
#### Under the Hood Stuff #####
27-
28-
# Use rdiscount as the markdown engine because it generates html5 compliant code for stuff like footnotes
29-
# If you use maroku (default engine) some of your generated pages may not validate or lint as html5
30-
# If you don't have it install it via gem install rdiscount
31-
markdown: kramdown
32-
33-
# Makes pretty (descriptive) permalinks. See Jekyll docs for alternatives.
34-
permalink: pretty
35-
36-
# How many articles do you wish to appear on the front page:
37-
paginate: 3
38-
39-
# Exclude metadata and development time dependencies (like Grunt plugins)
40-
# exclude: [README.markdown, package.json, grunt.js, Gruntfile.js, Gruntfile.coffee, node_modules]
41-
gems: [jekyll-paginate]

docker-compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: '3'
2+
services:
3+
jekyll:
4+
image: 'jekyll/jekyll:3.8'
5+
volumes:
6+
- "$PWD:/srv/jekyll"
7+
ports:
8+
- '4000:4000'
9+
command: jekyll serve --incremental
10+
tty: true

package.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

script/server

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Start the application
4+
5+
# Exit if docker-compose is not in PATH
6+
if ! command -v docker-compose &>/dev/null; then
7+
echo "Error! Missing dependency: docker-compose. Please install and try again."
8+
exit 1
9+
fi
10+
11+
# Exit if the Docker daemon isn't running
12+
if ! docker info &>/dev/null; then
13+
echo "The Docker daemon doesn't appear to be running. Please start Docker and try again."
14+
exit 1
15+
fi
16+
17+
# Remove _site directory if it exits
18+
[[ -d _site ]] && rm -r _site
19+
20+
docker-compose up --build

script/test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Test the app - if the game loads, everything is working!
4+
5+
# Create symlink to test game
6+
ln -s inde.html index.html
7+
8+
# Remove symlink on script exit
9+
trap "rm index.html" EXIT
10+
11+
# Start app
12+
script/server

0 commit comments

Comments
 (0)