Skip to content

Commit

Permalink
Merge pull request uwdub#89 from jayfo/base
Browse files Browse the repository at this point in the history
Update Base
  • Loading branch information
jayfo authored Sep 25, 2018
2 parents 5816932 + 62e43f9 commit f4a2672
Show file tree
Hide file tree
Showing 27 changed files with 651 additions and 281 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.DS_Store

# Python environment
/env35
/env36

# Python compilation
*.pyc
Expand Down
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,26 @@ sudo: false
language: python

python:
- "3.5.2"
- "3.6.6"

cache:
pip: true

install:
# Install Python dependencies
- python -m pip install --upgrade pip==9.0.1
- python -m pip install --upgrade pip==18.0
- python -m pip install -r requirements3.txt

# Install Node
- nvm install 4.5.0
- nvm install 8.12.0

# Install Ruby
- rvm @global do gem install bundler -v 1.13.6
- rvm install 2.3.3
- rvm use 2.3.3 --default
- rvm install 2.5.1
- rvm @global do gem install bundler -v 1.16.5
- rvm use 2.5.1 --default

# Invoke will get our other dependencies
- invoke update_dependencies
- invoke dependencies_ensure

script:
- nosetests tests.fast
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml.in
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ install:
{% endif %}
{% if ruby is defined and ruby.required %}
# Install Ruby
- rvm @global do gem install bundler -v {{ ruby.bundler_version }}
- rvm install {{ ruby.version }}
- rvm @global do gem install bundler -v {{ ruby.bundler_version }}
- rvm use {{ ruby.version }} --default

{% endif %}
Expand All @@ -58,7 +58,7 @@ install:

{% endif %}
# Invoke will get our other dependencies
- invoke update_dependencies
- invoke dependencies_ensure

script:
{% if docker is defined and docker.required %}
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source "https://rubygems.org"

ruby '2.3.3'
ruby '2.5.1'

gem 'jekyll'
65 changes: 41 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,42 +1,59 @@
GEM
remote: https://rubygems.org/
specs:
addressable (2.5.0)
public_suffix (~> 2.0, >= 2.0.2)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
colorator (1.1.0)
ffi (1.9.14)
ffi (1.9.14-x86-mingw32)
concurrent-ruby (1.0.5)
em-websocket (0.5.1)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
eventmachine (1.2.7-x86-mingw32)
ffi (1.9.25)
ffi (1.9.25-x86-mingw32)
forwardable-extended (2.6.0)
jekyll (3.3.1)
http_parser.rb (0.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jekyll (3.8.4)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (~> 0.7)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 3.0)
jekyll-watch (~> 2.0)
kramdown (~> 1.14)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (~> 1.7)
rouge (>= 1.7, < 4)
safe_yaml (~> 1.0)
jekyll-sass-converter (1.5.0)
jekyll-sass-converter (1.5.2)
sass (~> 3.4)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
kramdown (1.13.1)
liquid (3.0.6)
listen (3.0.8)
jekyll-watch (2.0.0)
listen (~> 3.0)
kramdown (1.17.0)
liquid (4.0.0)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
ruby_dep (~> 1.2)
mercenary (0.3.6)
pathutil (0.14.0)
pathutil (0.16.1)
forwardable-extended (~> 2.6)
public_suffix (2.0.4)
rb-fsevent (0.9.8)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
rouge (1.11.1)
public_suffix (3.0.3)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rouge (3.2.1)
ruby_dep (1.5.0)
safe_yaml (1.0.4)
sass (3.4.22)
sass (3.6.0)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)

PLATFORMS
ruby
Expand All @@ -46,7 +63,7 @@ DEPENDENCIES
jekyll

RUBY VERSION
ruby 2.3.3p222
ruby 2.5.1p57

BUNDLED WITH
1.13.6
1.16.5
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ Which is in turn based on:
[https://github.com/fogies/invoke-base](https://github.com/fogies/invoke-base)

Runtime dependencies for this project are:
- Python 3.5.2
- Node 4.5.0
- Ruby 2.3.3
- Ruby DevKit
- Python 3.6.6
- Node 8.12.0
- Ruby 2.5.1

See [Installation for Windows](https://github.com/fogies/web-jekyll-base/blob/master/readme/install_windows.md).

Expand Down
74 changes: 31 additions & 43 deletions _base_config.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
config:
python:
version: 3.5.2
pip_version: 9.0.1
# Python is currently pinned by this bug:
# https://github.com/travis-ci/travis-ci/issues/9815
version: 3.6.6
pip_version: 18.0
# Invoke is currently pinned by this bug:
# https://github.com/pyinvoke/invoke/issues/345
invoke_version: 0.12.2

node:
required: true
version: 4.5.0
version: 8.12.0

ruby:
required: true
version: 2.3.3
bundler_version: 1.13.6
version: 2.5.1
bundler_version: 1.16.5

docker:
required: false

toolbox:
version: v17.06.0a-ce
version: v18.06.1-ce

macos:
cmd_bash: /bin/bash
cmd_dockermachine: /usr/local/bin/docker-machine
windows:
cmd_bash: c:/Program Files/Git/bin/bash
cmd_dockermachine: c:/Program Files/Docker Toolbox/docker-machine.exe
cmd_bash: c:\Program Files\Git\bin\bash
cmd_dockermachine: c:\Program Files\Docker Toolbox\docker-machine.exe

travis:
version: 1.11.2-0~trusty
Expand Down Expand Up @@ -54,6 +56,8 @@ config:
build_test: base/readme/invoke/build_test.md
compile_config: base/readme/invoke/compile_config.md
compile_requirements: base/readme/invoke/compile_requirements.md
dependencies_ensure: base/readme/invoke/dependencies_ensure.md
dependencies_upgrade_base: base/readme/invoke/dependencies_upgrade_base.md
docker_console: base/readme/invoke/docker_console.md
docker_ip: base/readme/invoke/docker_ip.md
docker_localize: base/readme/invoke/docker_localize.md
Expand All @@ -62,55 +66,39 @@ config:
docker_stop: base/readme/invoke/docker_stop.md
serve_production: base/readme/invoke/serve_production.md
serve_test: base/readme/invoke/serve_test.md
update_base: base/readme/invoke/update_base.md
update_dependencies: base/readme/invoke/update_dependencies.md

python_versions:
- version: 3.5.2
virtual_environment_name: env35
- version: 3.7.0
virtual_environment_name: env37
requirements_name: requirements3.txt
windows:
installer_url: https://www.python.org/ftp/python/3.5.2/python-3.5.2.exe
install_path: c:/Python35
installer_url: https://www.python.org/ftp/python/3.7.0/python-3.7.0.exe
install_path: c:\Python37
- version: 3.6.6
virtual_environment_name: env36
requirements_name: requirements3.txt
windows:
installer_url: https://www.python.org/ftp/python/3.6.6/python-3.6.6.exe
install_path: c:\Python36

node_versions:
- version: 4.5.0
- version: 8.12.0
windows:
installer_url: https://nodejs.org/dist/v4.5.0/node-v4.5.0-x64.msi
installer_url: https://nodejs.org/dist/v8.12.0/node-v8.12.0-x64.msi

ruby_versions:
- version: 2.2.3
windows:
installer_url: https://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.2.3.exe
install_path: c:/Ruby223
installer_devkit_url: https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
install_devkit_path: c:/RubyDevKit
- version: 2.3.1
- version: 2.5.1
windows:
installer_url: https://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.3.1.exe
install_path: c:/Ruby231
installer_devkit_url: https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
install_devkit_path: c:/RubyDevKit
- version: 2.3.3
windows:
installer_url: https://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.3.3.exe
install_path: c:/Ruby233
installer_devkit_url: https://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe
install_devkit_path: c:/RubyDevKit
installer_url: https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.1-2/rubyinstaller-devkit-2.5.1-2-x86.exe
install_path: c:\Ruby251

docker_toolbox_versions:
- version: v17.06.0a-ce
macos:
installer_url: https://github.com/docker/toolbox/releases/download/v17.06.0a-ce/DockerToolbox-17.06.0a-ce.pkg
windows:
installer_url: https://github.com/docker/toolbox/releases/download/v17.06.0a-ce/DockerToolbox-17.06.0a-ce.exe
install_path: c:/Program Files/Docker Toolbox
- version: 1.12.3
- version: v18.06.1-ce
macos:
installer_url: https://github.com/docker/toolbox/releases/download/v1.12.3/DockerToolbox-1.12.3.pkg
installer_url: https://github.com/docker/toolbox/releases/download/v18.06.1-ce/DockerToolbox-18.06.1-ce.pkg
windows:
installer_url: https://github.com/docker/toolbox/releases/download/v1.12.3/DockerToolbox-1.12.3.exe
install_path: c:/Program Files/Docker Toolbox
installer_url: https://github.com/docker/toolbox/releases/download/v18.06.1-ce/DockerToolbox-18.06.1-ce.exe
install_path: c:\Program Files\Docker Toolbox

compile_config:
entries:
Expand Down
7 changes: 4 additions & 3 deletions base/invoke/tasks/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ def run(command, error_on_failure=True):

output = ''
for line in process.stdout:
line = str(line, encoding='utf-8')

output += line
try:
line = str(line, encoding='utf-8')

output += line

if sys.stdout.encoding:
print(
line.encode(
Expand Down
21 changes: 7 additions & 14 deletions base/invoke/tasks/update.py → base/invoke/tasks/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,10 @@
import yaml


@invoke.task
def update_base():
invoke.run('git pull https://github.com/fogies/web-jekyll-base.git master', encoding=sys.stdout.encoding)
invoke.run('git pull https://github.com/fogies/invoke-base.git master', encoding=sys.stdout.encoding)


@invoke.task(pre=[
base.invoke.tasks.compile.compile_config
])
def update_dependencies():
def dependencies_ensure():
# Check that we are internet connected
try:
response = requests.head(url='http://www.google.com', timeout=5)
Expand Down Expand Up @@ -77,13 +71,6 @@ def update_dependencies():
)
result = base.invoke.tasks.command.run(command)

# And only the correct Bundler version
# Expected to fail if no other versions of bundler are installed
command = 'gem uninstall bundler -v "!={}"'.format(
bundler_version_desired
)
result = base.invoke.tasks.command.run(command, error_on_failure=False)

# Check we have our Ruby dependencies
command = 'bundle check'
result = base.invoke.tasks.command.run(command, error_on_failure=False)
Expand All @@ -92,3 +79,9 @@ def update_dependencies():
if result.failed:
command = 'bundle install'
result = base.invoke.tasks.command.run(command)


@invoke.task
def dependencies_base_update():
invoke.run('git pull https://github.com/fogies/web-jekyll-base.git master', encoding=sys.stdout.encoding)
invoke.run('git pull https://github.com/fogies/invoke-base.git master', encoding=sys.stdout.encoding)
10 changes: 5 additions & 5 deletions base/invoke/tasks/jekyll.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
import base.invoke.tasks.update
import base.invoke.tasks.dependencies
import invoke
import sys


@invoke.task(pre=[base.invoke.tasks.update.update_dependencies])
@invoke.task(pre=[base.invoke.tasks.dependencies.dependencies_ensure])
def build_production():
invoke.run(
'bundle exec jekyll build -t --config _config.yml,_config-production.yml',
encoding=sys.stdout.encoding
)


@invoke.task(pre=[base.invoke.tasks.update.update_dependencies])
@invoke.task(pre=[base.invoke.tasks.dependencies.dependencies_ensure])
def build_test():
invoke.run(
'bundle exec jekyll build -t --config _config.yml,_config-test.yml',
encoding=sys.stdout.encoding
)


@invoke.task(pre=[base.invoke.tasks.update.update_dependencies])
@invoke.task(pre=[base.invoke.tasks.dependencies.dependencies_ensure])
def serve_production():
invoke.run(
'bundle exec jekyll serve -t --config _config.yml,_config-production.yml -H 0.0.0.0',
encoding=sys.stdout.encoding
)


@invoke.task(pre=[base.invoke.tasks.update.update_dependencies])
@invoke.task(pre=[base.invoke.tasks.dependencies.dependencies_ensure])
def serve_test():
invoke.run(
'bundle exec jekyll serve -t --config _config.yml,_config-test.yml --watch --force_polling',
Expand Down
Loading

0 comments on commit f4a2672

Please sign in to comment.