Skip to content

Commit

Permalink
Merge pull request #26 from joshukraine/gulp-update
Browse files Browse the repository at this point in the history
Gulp update
  • Loading branch information
joshukraine committed Oct 13, 2016
2 parents bd86582 + 0178dce commit a1f2d21
Show file tree
Hide file tree
Showing 58 changed files with 686 additions and 1,202 deletions.
25 changes: 25 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"env": {
"browser": true,
"commonjs": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
2
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
}
21 changes: 8 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
language: node_js
node_js:
- "5"

env:
global:
- secure: VZw0GE1/Sn3QW7fgNuvqqs31Mg8sbFeGpO/kxPc2vhe55Bopzc5ZriqSbWhNz26BZtvvZZuDC9Ap2BQmnJm9pq9lcLsLrKKr2d+Iv/5zekJbmuG5eYbr5wQsiJjT5R+wxRw31lfq+xikur59W8XXK115O3jGlMeENSStU91fpV2kJcUGJxUuZv/nAX5RZn48FSF9lhMAJeK7KVoBDS2BRvHOmk6JPM/joEb6LibCmzk4lCzmS0VPerJXr9k94DGKhnAjLROdi3C9E6I5t8Av+Sj9SXkhCJzSLQbsVa6e3fmkCaCM9uf+ELD2swPargQgNf97NHb5P3TYh30TL+Zms0X01b41CL+/jK0rLuoGz6xBjC0EOc1XkwzW9KgWhIaeer3kyDFLMB4dkrL8AoTCMkHN7ti7RPJi/xAYmT3ot5bdCbt8Rns8q+kLKRMu/ViJfPIVqjClly4yyefshSRrwzv8VprolVTwzMKvg8v25JAs80FODFb42206qF2MOa4/Gm0Edoxb5rcdJQFrQoCR0qbxk4V2rbRjIJqw3le4+/VwRHsbpB1FUKccU6WlBJrfllguaQLuGgEpT8gM0y1YhXAm5aFJ8JUBYyQ1H0UOafqiu2a+L61H3juimyU1207ivjklL/g+y2/2DjUa5ZldwHqD1S9dpI8jU0TkBLEq7IY=
- secure: yNqcBnXm1XDvwVR9W41y27vk1PjHEPjYmsQiTQMxk5zR9TKRA1fy66mC4ot3+OWGdfIcXmo9Ij/oYLwLevjY+PIr08isNGhre2OPYXDw8GP/YgrxeoIJnu9Grvhwa3e8KhsHyzaSsP73atX/cf/1bp00lON1DTho+BWv/94MZlK7TNJnTIpGQHcxWpyaKLgtG9q6/5uY+TJlZESOdgaH4xUR8FT+Qk+29/09SQQCBF6rbsQJuKpx7ZvzW9vIdtWT85pX1h1QJuXHWiVIMa1e+ualc0pxp9tpUXXl0KxyrvK7vWseXKjZzysQmXQVMMSxce25SY12bJeKTPk/6iPqtNzX9zRCaVb7i8TNb/veczESSXAuYKATRNxKlIw5OaAZB5r1Z4bASLfa7BfZHd1s/FRF6oi6fTpHJwwv4ujAp2U5vAUNur6q++qc+nHzjpsqKwJ0hZnyZBPkRnFZeO1wM4uyTtigpG0ovXUsVNWg1naRqblOlr1vFqX3X5vHAiLY/MSspW/XAz3RnSpp7XOa3RTKKjWNm0WBj6sgV4kwKQvR2SF3n5/MtjLFpBtC8Ia6olHVBuEs0PsLDgmw7yGQhjMzCc2IFJIv/mXGILebJgHVj0N8HgVb1Idlhjwy3xBgfiVCDiHZdFWUzXFTK2jjngXEnwE2fqF1fAmT/vB/t6k=
- "5"

before_install:
- rvm install 2.3.1
- rvm install 2.3.1

install:
- bundle install
- npm install -g lodash marked varstream svgicons2svgfont node-gyp ttf2woff2
- npm install -g gulp
- npm install
- bundle install
- npm install -g lodash marked varstream svgicons2svgfont node-gyp ttf2woff2
- npm install -g gulp-cli
- npm install

before_script: bin/rspec

script: bin/deploy
script: bundle exec middleman build --clean

branches:
only:
- master
- master
9 changes: 6 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ gem "middleman", "~> 4.1"
# https://github.com/middleman/middleman-minify-html#middleman-minify-html
gem "middleman-minify-html", "~> 3.4"

# https://rubygems.org/gems/sassc
gem "sassc", "~> 1.9"

# See http://bourbon.io/ for installation instructions
gem "bourbon", "~> 4.2"
gem "neat", "~> 1.8"
Expand All @@ -29,3 +26,9 @@ group :development do
gem "capybara", "~> 2.9"
gem "launchy", "~> 2.4"
end

# https://github.com/brigade/haml-lint
gem "haml_lint"

# https://github.com/brigade/scss-lint
gem "scss_lint"
31 changes: 25 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ GEM
tzinfo (~> 1.1)
addressable (2.4.0)
ansi (1.5.0)
ast (2.3.0)
backports (3.6.8)
bitters (1.2.0)
bourbon (>= 4.2)
Expand Down Expand Up @@ -61,6 +62,11 @@ GEM
formatador (0.2.5)
haml (4.0.7)
tilt
haml_lint (0.18.2)
haml (~> 4.0)
rake (>= 10, < 12)
rubocop (>= 0.36.0)
sysexits (~> 1.1)
hamster (3.0.0)
concurrent-ruby (~> 1.0)
hashie (3.4.6)
Expand Down Expand Up @@ -147,14 +153,19 @@ GEM
padrino-support (0.13.3.2)
activesupport (>= 3.1)
parallel (1.9.0)
parser (2.3.1.4)
ast (~> 2.2)
pkg-config (1.1.7)
powerpack (0.1.1)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
rainbow (2.1.0)
rake (11.3.0)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
ffi (>= 0.5.0)
Expand All @@ -171,14 +182,20 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
rubocop (0.43.0)
parser (>= 2.3.1.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.1)
sass (3.4.22)
sassc (1.10.0)
bundler
ffi (~> 1.9.6)
sass (>= 3.3.0)
scss_lint (0.50.2)
rake (>= 0.9, < 12)
sass (~> 3.4.20)
servolux (0.12.0)
slop (3.6.0)
sysexits (1.2.0)
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
Expand All @@ -189,6 +206,7 @@ GEM
unf (0.1.4)
unf_ext
unf_ext (0.0.7.2)
unicode-display_width (1.1.1)
xpath (2.0.0)
nokogiri (~> 1.3)

Expand All @@ -199,6 +217,7 @@ DEPENDENCIES
bitters (~> 1.2.0)
bourbon (~> 4.2)
capybara (~> 2.9)
haml_lint
launchy (~> 2.4)
middleman (~> 4.1)
middleman-minify-html (~> 3.4)
Expand All @@ -208,7 +227,7 @@ DEPENDENCIES
mime-types (~> 3.0)
neat (~> 1.8)
rspec (~> 3.5)
sassc (~> 1.9)
scss_lint

BUNDLED WITH
1.12.5
1.13.2
78 changes: 68 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,89 @@
# euroteamoutreach.org
euroteamoutreach.org
====================

[![Build Status](https://travis-ci.org/joshukraine/euroteamoutreach.org.svg?branch=master)](https://travis-ci.org/joshukraine/euroteamoutreach.org)

[euroteamoutreach.org](http://euroteamoutreach.org/) is the web site for Euro Team Outreach, Inc., a Christian organization dedicated to the advancement of the Gospel of Jesus Christ.
[euroteamoutreach.org](http://euroteamoutreach.org/) is the official web site for Euro Team Outreach, Inc., a Christian organization dedicated to the advancement of the Gospel of Jesus Christ.

This site was built using [Middleman 4](https://middlemanapp.com/).

![euroteamoutreach.org screenshot](https://s3.amazonaws.com/images.euroteamoutreach.org/eto-screenshot.jpg)

### Setup
Requirements
------------

* [Ruby 2.x](https://github.com/rbenv/rbenv#readme)
* [Node 5.x](https://github.com/creationix/nvm#readme)
* [Gulp CLI](https://github.com/gulpjs/gulp/blob/master/docs/getting-started.md#getting-started)


Setup
-----

To get started, clone the repo, cd into it, and run the setup script.

```sh
$ bin/setup
```

### Development
Development
-----------

This project uses [Gulp](http://gulpjs.com/) with Middleman's new [`external_pipeline`](https://middlemanapp.com/advanced/external-pipeline/) feature introduced in v4. When running the local development server, append `-e gulp` to [set the environment](https://middlemanapp.com/basics/upgrade-v4/#environments-and-changes-to-configure-blocks) to `gulp` and invoke the external pipeline.
This project uses [Gulp](http://gulpjs.com/) with Middleman's new [`external_pipeline`](https://middlemanapp.com/advanced/external-pipeline/) feature introduced in v4.

# With Gulp
$ bundle exec middleman server -e gulp

# Without Gulp
# Run the development server with Gulp
$ bundle exec middleman server

# Build the site (also invokes Gulp)
$ bundle exec middleman build

Environments
------------

Middleman has two default environments: `development` and `production`. This app is configured to run the external pipeline (Gulp in our case) in both. There are times, however, when the external pipeline should not run. Two good examples are tests and the console. We therefore define two additional environments: `test` and `console`.

Custom environments can be invoked on the command line with `-e` flag like so:

# Start the console in the console enviroment
$ bundle exec middleman console -e console

Code for custom environments is stored in `environments/<your-custom-env>.rb`. Note that custom environments can be invoked without the existence of a corresponding file in the `environments/` directory. If, for example, you merely wanted to start a server without the default `development` configs, you could run `middleman server -e <anything-here>`.

For completeness, all four environments used in this app have corresponding files:

```sh
environments/
├── console.rb
├── development.rb
├── production.rb
└── test.rb
```

Tests
-----

Testing is done with Rspec. Run the tests like so:

$ bin/rspec spec/

Aliases
-------

### Deployment
Consider adding the following to your `.bashrc` or `.zshrc` file:

```sh
mm='bundle exec middleman'
mmb='bundle exec middleman build --clean'
mmc='bundle exec middleman console -e console'
mms='bundle exec middleman server'
```

Deployment
----------

euroteamoutreach.org is currently deployed on Amazon S3. [Detailed instructions](http://docs.aws.amazon.com/gettingstarted/latest/swh/website-hosting-intro.html) are available from Amazon.

Legal
-----

Site content is copyrighted (c) 2016 by Euro Team Outreach, Inc. Software is under the [MIT license](https://github.com/joshukraine/euroteamoutreach.org/blob/master/LICENSE).
23 changes: 8 additions & 15 deletions config.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
activate :directory_indexes

set :css_dir, "stylesheets"
set :js_dir, "javascripts"
set :images_dir, "images"
set :relative_links, true
set :haml, { ugly: true, format: :html5 }
set :markdown, auto_ids: false
Expand All @@ -12,34 +9,30 @@
page "/*.txt", layout: false
page "/404.html", directory_index: false

configure :development do
activate :pry
end

configure :build do
activate :minify_html do |html|
html.remove_quotes = false
html.remove_intertag_spaces = true
end

activate :gzip

activate :external_pipeline,
name: :gulp,
command: "npm run production",
source: ".tmp",
latency: 1

activate :asset_hash, ignore: %r{^files/.*}
activate :gzip

activate :asset_hash, ignore: %r{^files/.*}
activate :asset_host,
host: "//d2amb9pccla9r3.cloudfront.net"

# https://github.com/Aupajo/middleman-search_engine_sitemap
set :url_root, "http://euroteamoutreach.org"
activate :search_engine_sitemap

ignore "javascripts/all.js"
ignore "stylesheets/site"

activate :minify_html do |html|
html.remove_quotes = false
html.remove_intertag_spaces = true
end
end

# https://github.com/fredjean/middleman-s3_sync
Expand Down
1 change: 1 addition & 0 deletions environments/console.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
activate :pry
7 changes: 7 additions & 0 deletions environments/development.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://middlemanapp.com/basics/upgrade-v4/#environments-and-changes-to-configure-blocks

activate :external_pipeline,
name: :gulp,
command: "npm run development",
source: ".tmp",
latency: 1
5 changes: 0 additions & 5 deletions environments/gulp.rb

This file was deleted.

4 changes: 4 additions & 0 deletions environments/production.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file is for reference only. Actual settings for the production
# environment are stored in the build configuation block in config.rb.
#
# https://middlemanapp.com/basics/upgrade-v4/#environments-and-changes-to-configure-blocks
4 changes: 4 additions & 0 deletions environments/test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file is for reference only. The test environment is set in
# spec/spec_helper.rb
#
# https://middlemanapp.com/basics/upgrade-v4/#environments-and-changes-to-configure-blocks

0 comments on commit a1f2d21

Please sign in to comment.