Skip to content

Commit

Permalink
Backend: Makefile Targets For 'deployment' and 'travis'
Browse files Browse the repository at this point in the history
* Set build server to use `make deployment`

* Create Makefile target for 'deployment' to update dependencies if
  necessary

* Set Travis CI to run `make travis`

* Create Makefile target for 'travis' to use additional automation logic
  • Loading branch information
harding committed Apr 12, 2015
1 parent ca7b971 commit 6a42d7b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ language: ruby
rvm:
- "2.0.0"

script: make all
script: make travis
12 changes: 11 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ source 'https://rubygems.org'
## to master
ruby '2.0.0'

## Used on the build server. If you add a package here (like nokogiri)
## that has non-Gem dependencies (like zlib), please remind the site
## maintainers that they need to manually update the build server(s)
## before they commit to master. If `bundle install` can satisify all
## your dependencies, then nothing extra needs to be done
group :development do
gem 'ffi-icu'
gem 'jekyll', '~>1.3.0'
Expand All @@ -15,6 +20,11 @@ group :development do
gem 'kramdown'
gem 'RedCloth'
gem 'therubyracer' # required by less
gem 'html-proofer'
end

## Not used on build server. Only used by developers and Travis CI, so
## you can put whatever you want here and bundler will tell us humans to
## install the new Gems.
group :slow_test do
gem 'html-proofer'
end
33 changes: 29 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,35 @@ test: pre-build-tests post-build-tests
valid: pre-build-tests-fast build post-build-tests-fast

## `make all`: build and run all tests
all: travis-background-keepalive pre-build-tests build post-build-tests
all: pre-build-tests build post-build-tests

## `make deployment`: for use on build server
deployment: install-deps-deployment \
valid

## `make travis`: for use with Travis CI
travis: travis-background-keepalive \
install-deps-development \
all

## Pre-build tests which, aggregated together, take less than 5 seconds to run on a typical PC



## Install dependencies (development version)
install-deps-development:
bundle install

## Install dependencies (deployment version)
install-deps-deployment:
bundle install --deployment --without :slow_test

## Pre-build tests which, aggregated together, take less than 10 seconds to run on a typical PC
pre-build-tests-fast: check-for-non-ascii-urls check-for-wrong-filename-assignments \
check-for-missing-rpc-summaries \
check-for-missing-copyright-licenses
check-for-missing-copyright-licenses \
check-bundle

## Post-build tests which, aggregated together, take less than 5 seconds to run on a typical PC
## Post-build tests which, aggregated together, take less than 10 seconds to run on a typical PC
post-build-tests-fast: check-for-build-errors ensure-each-svg-has-a-png check-for-liquid-errors \
check-for-missing-anchors check-for-broken-markdown-reference-links \
check-for-broken-kramdown-tables check-for-duplicate-header-ids \
Expand Down Expand Up @@ -206,6 +225,12 @@ check-for-broken-bitcoin-core-download-links:
check-html-proofer:
$S bundle exec ruby _contrib/bco-htmlproof

check-bundle:
## Ensure all the dependencies are installed. If you build without this
## check, you'll get confusing error messages when your deps aren't up
## to date
$S ! bundle check | grep -v "The Gemfile's dependencies are satisfied"

travis-background-keepalive:
$S { while ps aux | grep -q '[m]ake' ; do echo "Ignore me: Travis CI keep alive" ; sleep 1m ; done ; } &

Expand Down
2 changes: 1 addition & 1 deletion _build/update_site.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ lasttime=`stat -c %Y "$SITEDIR/_buildlock" | cut -d ' ' -f1`
# Build website in a child process
(
cd $WORKDIR
make valid && touch "$WORKDIR/_builddone" || touch "$WORKDIR/_buildfail"
make deployment && touch "$WORKDIR/_builddone" || touch "$WORKDIR/_buildfail"
)&

# Loop every 1 second to check status
Expand Down

0 comments on commit 6a42d7b

Please sign in to comment.