Skip to content

Commit

Permalink
Switching Travis to use Bikeshed rest API for quicker & simpler builds
Browse files Browse the repository at this point in the history
  • Loading branch information
jakearchibald committed Feb 11, 2019
1 parent c05f53f commit 42dec26
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
8 changes: 1 addition & 7 deletions .travis.yml
@@ -1,12 +1,6 @@
sudo: false
language: python
language: generic
python:
- '2.7'
install:
- pip install pygments lxml setuptools --upgrade
- git clone https://github.com/tabatkins/bikeshed.git
- pip install --editable $PWD/bikeshed
- bikeshed update
script:
- bash "./deploy.sh"
env:
Expand Down
26 changes: 25 additions & 1 deletion compile.sh
@@ -1,7 +1,31 @@
#!/bin/bash
set -e # Exit with nonzero exit code if anything fails

cd docs && bikeshed spec
INPUT_FILE=$(find . -maxdepth 2 -name "*.bs" -print -quit)

curlretry() {
curl --retry 2 "$@"
}

curlbikeshed() {
# The Accept: header ensures we get the error output even when warnings are produced, per
# https://github.com/whatwg/whatwg.org/issues/227#issuecomment-419969339.
HTTP_STATUS=$(curlretry https://api.csswg.org/bikeshed/ \
--output "$1" \
--write-out "%{http_code}" \
--header "Accept: text/plain, text/html" \
-F die-on=error \
-F file=@"$INPUT_FILE" \
"${@:2}")

if [[ "$HTTP_STATUS" != "200" ]]; then
cat "$1"
rm -f "$1"
exit 22
fi
}

curlbikeshed "index.html"

if [ -d out ]; then
echo Copy the generated spec into out/index.html
Expand Down

0 comments on commit 42dec26

Please sign in to comment.