diff --git a/.gitignore b/.gitignore index ca35be0..c1c2f08 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ +.jekyll-metadata +Gemfile.lock _site diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..d15e661 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,23 @@ +#bootstrap and build +before_script: "./script/bootstrap" +script: "./script/cibuild" + +#environment +language: ruby +rvm: + - 2.0.0 + +branches: + only: + - gh-pages + - /.*/ + +notifications: + email: false + +env: + global: + - NOKOGIRI_USE_SYSTEM_LIBRARIES=true + +sudo: false +cache: bundler diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..b29120b --- /dev/null +++ b/Gemfile @@ -0,0 +1,14 @@ +source 'https://rubygems.org' + +require 'json' +require 'open-uri' +versions = JSON.parse(open('https://pages.github.com/versions.json').read) + +gem 'github-pages', versions['github-pages'] + +group :test do + gem 'html-proofer', '~> 3.0' + gem 'rake' + gem 'rspec' + gem 'nokogiri' +end diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..5b84c5a --- /dev/null +++ b/Rakefile @@ -0,0 +1,10 @@ +require 'html-proofer' +require 'rspec/core/rake_task' + +task :test do + sh 'bundle exec jekyll build' + HTMLProofer.check_directory('./_site', + check_html: true, + validation: { ignore_script_embeds: true }, + url_swap: { %r{http://opendefinition.org} => '' }).run +end diff --git a/script/bootstrap b/script/bootstrap new file mode 100755 index 0000000..baa9e1f --- /dev/null +++ b/script/bootstrap @@ -0,0 +1,10 @@ +#!/bin/sh + +set -e + +echo "bundling installin'" +gem install bundler +bundle install + +echo +echo "You're all set. Just run script/server!" diff --git a/script/cibuild b/script/cibuild new file mode 100755 index 0000000..241f1f7 --- /dev/null +++ b/script/cibuild @@ -0,0 +1,6 @@ +#!/bin/sh + +set -e + +echo "building the site..." +bundle exec rake test diff --git a/script/server b/script/server new file mode 100755 index 0000000..3994cca --- /dev/null +++ b/script/server @@ -0,0 +1,9 @@ +#!/bin/sh + +set -e + +echo "spinning up the server..." +bundle exec jekyll serve --watch --incremental --trace + +echo "cleaning up..." +rm -Rf _site