Skip to content

Commit

Permalink
feat: add package validator to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks authored and joachimvh committed Sep 4, 2020
1 parent ab8289a commit 7fae320
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -9,6 +9,7 @@ script:
- npm run lint
- npm run validate
- npm run test
- .travis/validate-package.sh
after_success:
- npm run coveralls
cache: npm
31 changes: 31 additions & 0 deletions .travis/validate-package.sh
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# Script to validate our packed package

npm pack
tar -xzf solid-community-server-*.tgz
pushd package

# Check if our server can start at a given port
node bin/server.js -p 8888 &
pid=$!
i=0
EXITCODE=0
until curl -s localhost:8888; do
sleep 1

# Try for at most 10 seconds, assume failure otherwise
let i++
if [ $i -gt 10 ]; then
echo "Server start timeout"
echo " Server may have failed to start, or is running at an unexpected port."
kill -9 $pid
EXITCODE=1
break;
fi
done > /dev/null
kill -9 $pid

popd
rm -r package
rm solid-community-server-*.tgz
exit $EXITCODE

0 comments on commit 7fae320

Please sign in to comment.