Skip to content

Commit

Permalink
Release tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Weigel committed Jan 28, 2019
1 parent 450f8a8 commit 370eb31
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 22 deletions.
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -37,24 +37,24 @@ A list of catalogs that are served using this sofware is given at [http://hapi-s
OS-X x64:

```bash
curl -L https://github.com/hapi-server/server-nodejs/releases/download/v0.9.3/hapi-server-v0.9.3-darwin-x64.tgz | tar zx
cd hapi-server-v0.9.3
curl -L https://github.com/hapi-server/server-nodejs/releases/download/v0.9.4/hapi-server-v0.9.4
cd hapi-server-v0.9.4
./hapi-server --open
```

Linux x64:

```bash
curl -L https://github.com/hapi-server/server-nodejs/releases/download/v0.9.3/hapi-server-v0.9.3-linux-x64.tgz | tar zx
cd hapi-server-v0.9.3
curl -L https://github.com/hapi-server/server-nodejs/releases/download/v0.9.4/hapi-server-v0.9.4
cd hapi-server-v0.9.4
./hapi-server --open
```

Linux ARMv7l:

```bash
curl -L https://github.com/hapi-server/server-nodejs/releases/download/v0.9.3/hapi-server-v0.9.3-linux-armv7l.tgz | tar zx
cd hapi-server-v0.9.3
curl -L https://github.com/hapi-server/server-nodejs/releases/download/v0.9.4/hapi-server-v0.9.4
cd hapi-server-v0.9.4
./hapi-server --open
```

Expand Down
38 changes: 23 additions & 15 deletions hapi-server
Expand Up @@ -5,25 +5,33 @@ versionmin="v6.0.0"
# From https://unix.stackexchange.com/a/76518
path=$(exec 2>/dev/null;cd -- $(dirname "$0"); unset PWD; /usr/bin/pwd || /bin/pwd || pwd)

if test "$1" = "test"; then
# ./hapi-server test
com="$path/test/server-test.js $@"
else
# ./hapi-server [server.js args]
com="$path/server.js $@"
fi

# Use node in path if version > versionmin
if command -v node > /dev/null 2>&1; then
version=$(node -v)
if [[ $version > $versionmin ]]; then
node $path"/server.js" $@
exit 0
fi
version=$(node -v)
if test $version > $versionmin; then
node $com
exit 0
fi
elif command -v nodejs > /dev/null 2>&1; then
version=$(nodejs -v)
if [[ $version > $versionmin ]]; then
nodejs $path"/server.js" $@
exit 0
fi
version=$(nodejs -v)
if test $version > $versionmin; then
nodejs $com
exit 0
fi
fi

# Use node in package
if command -v path"/bin/node" > /dev/null 2>&1; then
path"/bin/node" $path"/server.js" $@
# Use node in hapi-server package
if command -v $path"/bin/node" > /dev/null 2>&1; then
$path"/bin/node" $com
else
echo "Did not find "$(dirname "$SCRIPT")"/bin/node, node, or nodejs"
exit 1
echo "Did not find "$(dirname "$SCRIPT")"/bin/node, node, or nodejs"
exit 1
fi
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -30,6 +30,7 @@
"test": "node test/server-test.js; node test/subset-test.js",
"start": "node server.js --port 8999",
"package": "cd pkg; make update VERSION=v$npm_package_version",
"test-packages": "cd pkg; make test-packages VERSION=v$npm_package_version",
"release": "cd pkg; make release VERSION=v$npm_package_version"
},
"bin": "server.js",
Expand Down
7 changes: 6 additions & 1 deletion pkg/Makefile
Expand Up @@ -36,7 +36,12 @@ update:
make package VERSION=$(VERSION) OS=linux-armv7l
rm -rf dist/hapi-server-$(VERSION)/

update-test:
test-packages:
make package-test VERSION=$(VERSION) OS=darwin-x64
make package-test VERSION=$(VERSION) OS=linux-x64
make package-test VERSION=$(VERSION) OS=linux-armv7l

package-test:
scp dist/hapi-server-$(VERSION)-$(OS).tgz weigel@$(SERVER):
ssh weigel@$(SERVER) 'tar zxf hapi-server-$(VERSION)-$(OS).tgz; cd hapi-server-$(VERSION); ./hapi-server test'

Expand Down

0 comments on commit 370eb31

Please sign in to comment.