Skip to content

Commit 42dec26

Browse files
committed
Switching Travis to use Bikeshed rest API for quicker & simpler builds
1 parent c05f53f commit 42dec26

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

.travis.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
sudo: false
2-
language: python
1+
language: generic
32
python:
43
- '2.7'
5-
install:
6-
- pip install pygments lxml setuptools --upgrade
7-
- git clone https://github.com/tabatkins/bikeshed.git
8-
- pip install --editable $PWD/bikeshed
9-
- bikeshed update
104
script:
115
- bash "./deploy.sh"
126
env:

compile.sh

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,31 @@
11
#!/bin/bash
22
set -e # Exit with nonzero exit code if anything fails
33

4-
cd docs && bikeshed spec
4+
INPUT_FILE=$(find . -maxdepth 2 -name "*.bs" -print -quit)
5+
6+
curlretry() {
7+
curl --retry 2 "$@"
8+
}
9+
10+
curlbikeshed() {
11+
# The Accept: header ensures we get the error output even when warnings are produced, per
12+
# https://github.com/whatwg/whatwg.org/issues/227#issuecomment-419969339.
13+
HTTP_STATUS=$(curlretry https://api.csswg.org/bikeshed/ \
14+
--output "$1" \
15+
--write-out "%{http_code}" \
16+
--header "Accept: text/plain, text/html" \
17+
-F die-on=error \
18+
-F file=@"$INPUT_FILE" \
19+
"${@:2}")
20+
21+
if [[ "$HTTP_STATUS" != "200" ]]; then
22+
cat "$1"
23+
rm -f "$1"
24+
exit 22
25+
fi
26+
}
27+
28+
curlbikeshed "index.html"
529

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

0 commit comments

Comments
 (0)