Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab8289a
commit 7fae320
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |