Backend: Makefile Targets For 'deployment' and 'travis'

* 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
This commit is contained in:
David A. Harding 2015-04-12 10:00:40 -04:00
parent ca7b97134d
commit 6a42d7b861
No known key found for this signature in database
GPG key ID: 4B29C30FF29EC4B7
4 changed files with 42 additions and 7 deletions

View file

@ -2,4 +2,4 @@ language: ruby
rvm: rvm:
- "2.0.0" - "2.0.0"
script: make all script: make travis

12
Gemfile
View file

@ -7,6 +7,11 @@ source 'https://rubygems.org'
## to master ## to master
ruby '2.0.0' 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 group :development do
gem 'ffi-icu' gem 'ffi-icu'
gem 'jekyll', '~>1.3.0' gem 'jekyll', '~>1.3.0'
@ -15,6 +20,11 @@ group :development do
gem 'kramdown' gem 'kramdown'
gem 'RedCloth' gem 'RedCloth'
gem 'therubyracer' # required by less gem 'therubyracer' # required by less
gem 'html-proofer'
end 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

View file

@ -21,16 +21,35 @@ test: pre-build-tests post-build-tests
valid: pre-build-tests-fast build post-build-tests-fast valid: pre-build-tests-fast build post-build-tests-fast
## `make all`: build and run all tests ## `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 \ pre-build-tests-fast: check-for-non-ascii-urls check-for-wrong-filename-assignments \
check-for-missing-rpc-summaries \ 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 \ 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-missing-anchors check-for-broken-markdown-reference-links \
check-for-broken-kramdown-tables check-for-duplicate-header-ids \ check-for-broken-kramdown-tables check-for-duplicate-header-ids \
@ -206,6 +225,12 @@ check-for-broken-bitcoin-core-download-links:
check-html-proofer: check-html-proofer:
$S bundle exec ruby _contrib/bco-htmlproof $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: travis-background-keepalive:
$S { while ps aux | grep -q '[m]ake' ; do echo "Ignore me: Travis CI keep alive" ; sleep 1m ; done ; } & $S { while ps aux | grep -q '[m]ake' ; do echo "Ignore me: Travis CI keep alive" ; sleep 1m ; done ; } &

View file

@ -49,7 +49,7 @@ lasttime=`stat -c %Y "$SITEDIR/_buildlock" | cut -d ' ' -f1`
# Build website in a child process # Build website in a child process
( (
cd $WORKDIR 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 # Loop every 1 second to check status