Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
language: node_js
node_js:
- "0.11"
- "0.12"
- "iojs"
- "4"
- "6"
- "7"
before_install:
- npm install -g npm@2
before_script:
- mkdir prism
- mkdir prism/bin
- export PATH=$PATH:$PWD/prism/bin/
- ./test/prism.sh
script:
- npm test
- npm run test:typescript
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"mocha-sinon": "^1.1.5",
"sinon": "^1.17.5",
"sinon-chai": "^2.8.0",
"system-sleep": "^1.0.0-g",
"typescript": "^2.0.0"
},
"scripts": {
Expand Down
42 changes: 42 additions & 0 deletions test/prism.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

install () {

set -eu

UNAME=$(uname)
ARCH=$(uname -m)
if [ "$UNAME" != "Linux" ] && [ "$UNAME" != "Darwin" ] && [ "$ARCH" != "x86_64" ] && [ "$ARCH" != "i686" ]; then
echo "Sorry, OS/Architecture not supported: ${UNAME}/${ARCH}. Download binary from https://github.com/stoplightio/prism/releases"
exit 1
fi

if [ "$UNAME" = "Darwin" ] ; then
OSX_ARCH=$(uname -m)
if [ "${OSX_ARCH}" = "x86_64" ] ; then
PLATFORM="darwin_amd64"
fi
elif [ "$UNAME" = "Linux" ] ; then
LINUX_ARCH=$(uname -m)
if [ "${LINUX_ARCH}" = "i686" ] ; then
PLATFORM="linux_386"
elif [ "${LINUX_ARCH}" = "x86_64" ] ; then
PLATFORM="linux_amd64"
fi
fi

#LATEST=$(curl -s https://api.github.com/repos/stoplightio/prism/tags | grep -Eo '"name":.*?[^\\]",' | head -n 1 | sed 's/[," ]//g' | cut -d ':' -f 2)
LATEST="v0.1.5"
URL="https://github.com/stoplightio/prism/releases/download/$LATEST/prism_$PLATFORM"
DEST=./prism/bin/prism

if [ -z $LATEST ] ; then
echo "Error requesting. Download binary from ${URL}"
exit 1
else
curl -L $URL -o $DEST
chmod +x $DEST
fi
}

install
Loading