Skip to content

Commit

Permalink
Create scripts and Docker Compose file for easier testing (#21)
Browse files Browse the repository at this point in the history
* Create scripts and Docker Compose file

* Remove unnecessary options from _config.yml
  • Loading branch information
parkerbxyz authored May 28, 2021
1 parent a38418d commit 7e65a83
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 63 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
vendor/
_site/
.sass-cache/
.jekyll-cache/
.jekyll-metadata
.bundle/
4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
source "https://rubygems.org"

gem "github-pages", ">= 200"
gem "minitest"
gem "test-unit"
gem 'github-pages', group: :jekyll_plugins
13 changes: 3 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -213,22 +213,19 @@ GEM
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mini_portile2 (2.5.1)
minima (2.5.1)
jekyll (>= 3.5, < 5.0)
jekyll-feed (~> 0.9)
jekyll-seo-tag (~> 2.1)
minitest (5.14.4)
multipart-post (2.1.1)
nokogiri (1.11.6)
mini_portile2 (~> 2.5.0)
nokogiri (1.11.6-x86_64-linux)
racc (~> 1.4)
octokit (4.21.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
power_assert (2.0.0)
public_suffix (4.0.6)
racc (1.5.2)
rb-fsevent (0.11.0)
Expand All @@ -253,8 +250,6 @@ GEM
unf (~> 0.1.4)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
test-unit (3.4.1)
power_assert
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
Expand All @@ -270,9 +265,7 @@ PLATFORMS
ruby

DEPENDENCIES
github-pages (>= 200)
minitest
test-unit
github-pages

BUNDLED WITH
2.2.6
2.0.2
42 changes: 2 additions & 40 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,3 @@
# Name of your blog (this will show up at the top of your page and in the RSS feed)
# Set name to prevent title from displaying at the top of the page
# https://github.com/pages-themes/primer/issues/21#issuecomment-440722302
name: GitHub Games

# Short description (goes below the title; it will also be used in the RSS feed)
description: This GitHub Games has lots of tests

# Your name, as you want it to appear underneath each post and in the footer
author: GitHub Training, but forked

# Your email if you want it to be linked on the contact page
author_email: [email protected]

# The directory for category index pages. Change it to something else if
# for example you want links like /categories/category1 instead of /category1
category_dir: /

# Uncomment if you are planning to run the blog in a subdirectory
# Note - if you enable this, and attempt to view your site locally you have to use the baseurl in your local path.
# Example, you must use http://localhost:4000/path/to/blog
#baseurl: /path/to/blog
# baseurl:

# The URL of your actual domain. This will be used to make absolute links in the RSS feed.
# url: http://yourdomain.com/

#### Under the Hood Stuff #####

# Use rdiscount as the markdown engine because it generates html5 compliant code for stuff like footnotes
# If you use maroku (default engine) some of your generated pages may not validate or lint as html5
# If you don't have it install it via gem install rdiscount
markdown: kramdown

# Makes pretty (descriptive) permalinks. See Jekyll docs for alternatives.
permalink: pretty

# How many articles do you wish to appear on the front page:
paginate: 3

# Exclude metadata and development time dependencies (like Grunt plugins)
# exclude: [README.markdown, package.json, grunt.js, Gruntfile.js, Gruntfile.coffee, node_modules]
gems: [jekyll-paginate]
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3'
services:
jekyll:
image: 'jekyll/jekyll:3.8'
volumes:
- "$PWD:/srv/jekyll"
ports:
- '4000:4000'
command: jekyll serve --incremental
tty: true
10 changes: 0 additions & 10 deletions package.json

This file was deleted.

20 changes: 20 additions & 0 deletions script/server
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
#
# Start the application

# Exit if docker-compose is not in PATH
if ! command -v docker-compose &>/dev/null; then
echo "Error! Missing dependency: docker-compose. Please install and try again."
exit 1
fi

# Exit if the Docker daemon isn't running
if ! docker info &>/dev/null; then
echo "The Docker daemon doesn't appear to be running. Please start Docker and try again."
exit 1
fi

# Remove _site directory if it exits
[[ -d _site ]] && rm -r _site

docker-compose up --build
12 changes: 12 additions & 0 deletions script/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
#
# Test the app - if the game loads, everything is working!

# Create symlink to test game
ln -s inde.html index.html

# Remove symlink on script exit
trap "rm index.html" EXIT

# Start app
script/server

0 comments on commit 7e65a83

Please sign in to comment.