Commit 53129b02 by Dane Springmeyer

[wip] break out node vs node-webkit builds

parent cb835651
language: cpp
# http://docs.travis-ci.com/user/multi-os/
os:
- linux
- osx
env:
matrix:
- export NODE_VERSION="0.8"
......@@ -16,7 +21,6 @@ before_install:
- COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\n')
# put node-pre-gyp on path
- export PATH=./node_modules/.bin/:$PATH
- echo $NODE_VERSION
- git clone https://github.com/creationix/nvm.git ../.nvm
- source ../.nvm/nvm.sh
- nvm install $NODE_VERSION
......@@ -26,96 +30,10 @@ before_install:
- platform=$(uname -s | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/")
install:
# test installing from source
- npm install --build-from-source
- npm test
- if [[ "${NODE_WEBKIT_VERSION}" != "" ]]; then ./scripts/build_against_node_webkit.sh; else ./build_against_node.sh; fi
before_script:
# test publishing
- PUBLISH_BINARY=false
# check if this is a git tag built statically to be portable
#- if [[ $TRAVIS_BRANCH == `git describe --tags --always HEAD` ]]; then echo PUBLISH_BINARY;PUBLISH_BINARY=true; fi;
# or check if we are manually requesting binary publishing via a commit keyword
- if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then echo PUBLISH_BINARY;PUBLISH_BINARY=true; fi;
- if [[ ${PUBLISH_BINARY} == true ]]; then node-pre-gyp package publish; fi
# for testing node-webkit, launch a virtual display
- if [ "$NODE_WEBKIT" != "" ]; then export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start +extension RANDR; fi
# note: `sleep 3` gives xvfb some time to start
- true
script:
# test install from published binary
- make clean
- npm install
- npm test
- make clean
# test source compile against system libsqlite3
- if [[ "$platform" == 'linux' ]]; then sudo apt-get -qq update; sudo apt-get -qq install libsqlite3-dev; fi
- make clean
- npm install --build-from-source --sqlite=/usr
- npm test
# on Linux 64 bit: install nw-gyp if NODE_WEBKIT is not empty
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then npm install nw-gyp -g; fi; fi
# on Linux 64 bit: rebuild node-sqlite3 for 64 bit node-webkit target (if NODE_WEBKIT is not empty)
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then node-pre-gyp rebuild --runtime=node-webkit --target=$NODE_WEBKIT; fi; fi
# on Linux 64 bit: download and unpack node-webkit, add it to PATH
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then wget http://dl.node-webkit.org/v${NODE_WEBKIT}/node-webkit-v${NODE_WEBKIT}-linux-x64.tar.gz; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then tar xf node-webkit-v${NODE_WEBKIT}-linux-x64.tar.gz; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then prenwpath="$PATH"; export PATH=$(pwd)/node-webkit-v${NODE_WEBKIT}-linux-x64:$PATH; fi; fi
# on Linux 64 bit: ldd nw
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then ldd $(pwd)/node-webkit-v${NODE_WEBKIT}-linux-x64/nw; fi; fi
# on Linux 64 bit: attempt node-pre-gyp package testpackage (if NODE_WEBKIT is not empty)
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then node-pre-gyp package testpackage --runtime=node-webkit --target=$NODE_WEBKIT --overwrite; fi; fi
# on Linux 64 bit: erase used node-webkit, restore PATH
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then export PATH="$prenwpath"; rm -rf node-webkit-v${NODE_WEBKIT}-linux-x64; fi; fi
- make clean
# node v0.8 and above provide pre-built 32 bit and 64 bit binaries
# so here we use the 32 bit ones to also test 32 bit builds
- NVER=`node -v`
- wget http://nodejs.org/dist/${NVER}/node-${NVER}-${platform}-x86.tar.gz
- tar xf node-${NVER}-${platform}-x86.tar.gz
# enable 32 bit node
- export PATH=$(pwd)/node-${NVER}-${platform}-x86/bin:$PATH
# install 32 bit compiler toolchain and X11
- if [[ "$platform" == 'linux' ]]; then sudo apt-get -y install gcc-multilib g++-multilib; fi
# test source compile in 32 bit mode with internal libsqlite3
- if [[ "$platform" == 'linux' ]]; then CC=gcc-4.6 CXX=g++-4.6 npm install --build-from-source; else npm install --build-from-source; fi
- npm test
# publish 32 bit build
- if [[ ${PUBLISH_BINARY} == true ]]; then node-pre-gyp package publish; fi;
# install nw-gyp in 32 bit environment if NODE_WEBKIT is not empty (but on Linux it's installed earlier on 64 bit)
- if [ "$platform" != 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then npm install nw-gyp -g; fi; fi
# rebuild node-sqlite3 for 32 bit node-webkit target (if NODE_WEBKIT is not empty)
- if [ "$NODE_WEBKIT" != "" ]; then node-pre-gyp rebuild --runtime=node-webkit --target=$NODE_WEBKIT; fi;
# on Linux 32 bit: install 32 bit stuff necessary for node-webkit 32 bit
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libx11-6:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libglib2.0-0:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libgtk2.0-0:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libatk1.0-0:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libgdk-pixbuf2.0-0:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libcairo2:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libfreetype6:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libfontconfig1:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libxcomposite1:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libasound2:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libxdamage1:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libxext6:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libxfixes3:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libnss3:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libnspr4:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libgconf-2-4:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libexpat1:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libdbus-1-3:i386; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then sudo apt-get -y install libudev0:i386; fi; fi
# on Linux 32 bit: download and unpack node-webkit, add it to PATH
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then wget http://dl.node-webkit.org/v${NODE_WEBKIT}/node-webkit-v${NODE_WEBKIT}-linux-ia32.tar.gz; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then tar xf node-webkit-v${NODE_WEBKIT}-linux-ia32.tar.gz; fi; fi
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then prenwpath="$PATH"; export PATH=$(pwd)/node-webkit-v${NODE_WEBKIT}-linux-ia32:$PATH; fi; fi
# on Linux 32 bit: ldd nw
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then ldd $(pwd)/node-webkit-v${NODE_WEBKIT}-linux-ia32/nw; fi; fi
# attempt node-pre-gyp package testpackage (if NODE_WEBKIT is not empty)
- if [ "$NODE_WEBKIT" != "" ]; then node-pre-gyp package testpackage --runtime=node-webkit --target=$NODE_WEBKIT --overwrite; fi;
# on Linux 32 bit: erase used node-webkit, restore PATH
- if [ "$platform" = 'linux' ]; then if [ "$NODE_WEBKIT" != "" ]; then export PATH="$prenwpath"; rm -rf node-webkit-v${NODE_WEBKIT}-linux-ia32; fi; fi
- make clean
# test source compile in 32 bit mode against external libsqlite3
- if [[ "$platform" == 'linux' ]]; then sudo apt-get -y install libsqlite3-dev:i386; CC=gcc-4.6 CXX=g++-4.6 npm install --build-from-source --sqlite=/usr; npm test; fi
- true
#!/usr/bin/env bash
set -u -e
# test installing from source
npm install --build-from-source
node-pre-gyp package testpackage
npm test
PUBLISH_BINARY=false
if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then
node-pre-gyp publish
node-pre-gyp info
node-pre-gyp clean
make clean
# now install from binary
INSTALL_RESULT=$(npm install --fallback-to-build=false > /dev/null)$? || true
# if install returned non zero (errored) then we first unpublish and then call false so travis will bail at this line
if [[ $INSTALL_RESULT != 0 ]]; then echo "returned $INSTALL_RESULT";node-pre-gyp unpublish;false; fi
# If success then we arrive here so lets clean up
node-pre-gyp clean
fi
# now test building against shared sqlite
if [[ $(uname -s) == 'Darwin' ]]; then
brew install sqlite
npm install --build-from-source --sqlite=$(brew --prefix)
else
sudo apt-get -qq update
sudo apt-get -qq install libsqlite3-dev
npm install --build-from-source --sqlite=/usr
fi
npm test
if [[ $(uname -s) == 'Linux' ]]; then
sudo apt-get -y install gcc-multilib g++-multilib; fi
# node v0.8 and above provide pre-built 32 bit and 64 bit binaries
# so here we use the 32 bit ones to also test 32 bit builds
NVER=`node -v`
wget http://nodejs.org/dist/${NVER}/node-${NVER}-${platform}-x86.tar.gz
tar xf node-${NVER}-${platform}-x86.tar.gz
# enable 32 bit node
export PATH=$(pwd)/node-${NVER}-${platform}-x86/bin:$PATH
# install 32 bit compiler toolchain and X11
# test source compile in 32 bit mode with internal libsqlite3
CC=gcc-4.6 CXX=g++-4.6 npm install --build-from-source
npm install --build-from-source
npm test
if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then
node-pre-gyp package publish
fi
make clean
# test source compile in 32 bit mode against external libsqlite3
sudo apt-get -y install libsqlite3-dev:i386
CC=gcc-4.6 CXX=g++-4.6 npm install --build-from-source --sqlite=/usr
npm test
fi
#!/usr/bin/env bash
set -u -e
# for testing node-webkit, launch a virtual display
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start +extension RANDR
npm install nw-gyp
node-pre-gyp rebuild --runtime=node-webkit --target=$NODE_WEBKIT
# now we need node-webkit itself to test
OLD_PATH="$PATH"
if [[ $(uname -s) == 'Darwin' ]]; then
export NW_DOWNLOAD=node-webkit-v${NODE_WEBKIT}-osx-ia32
wget http://dl.node-webkit.org/v${NODE_WEBKIT}/${NW_DOWNLOAD}.tar.gz
unzip ${NW_DOWNLOAD}.zip
export PATH=$(pwd)/${NW_DOWNLOAD}:$PATH
else
export NW_DOWNLOAD=node-webkit-v${NODE_WEBKIT}-linux-x64
wget http://dl.node-webkit.org/v${NODE_WEBKIT}/${NW_DOWNLOAD}.tar.gz
tar xf ${NW_DOWNLOAD}.tar.gz
export PATH=$(pwd)/${NW_DOWNLOAD}:$PATH
fi
# test the package
node-pre-gyp package testpackage --runtime=node-webkit --target=$NODE_WEBKIT
PUBLISH_BINARY=false
if test "${COMMIT_MESSAGE#*'[publish binary]'}" != "$COMMIT_MESSAGE"; then
node-pre-gyp publish --runtime=node-webkit --target=$NODE_WEBKIT
node-pre-gyp info --runtime=node-webkit --target=$NODE_WEBKIT
node-pre-gyp clean --runtime=node-webkit --target=$NODE_WEBKIT
make clean
# now install from binary
INSTALL_RESULT=$(npm install --runtime=node-webkit --target=$NODE_WEBKIT --fallback-to-build=false > /dev/null)$? || true
# if install returned non zero (errored) then we first unpublish and then call false so travis will bail at this line
if [[ $INSTALL_RESULT != 0 ]]; then echo "returned $INSTALL_RESULT";node-pre-gyp unpublish --runtime=node-webkit --target=$NODE_WEBKIT;false; fi
# If success then we arrive here so lets clean up
node-pre-gyp clean --runtime=node-webkit --target=$NODE_WEBKIT
fi
# restore PATH
export PATH="$OLD_PATH"
rm -rf ${NW_DOWNLOAD}
# TODO linux 32 bit
: '
# rebuild node-sqlite3 for 32 bit node-webkit target (if NODE_WEBKIT is not empty)
node-pre-gyp rebuild --runtime=node-webkit --target=$NODE_WEBKIT
# on Linux 32 bit: install 32 bit stuff necessary for node-webkit 32 bit
sudo apt-get -y install libx11-6:i386
sudo apt-get -y install libglib2.0-0:i386
sudo apt-get -y install libgtk2.0-0:i386
sudo apt-get -y install libatk1.0-0:i386
sudo apt-get -y install libgdk-pixbuf2.0-0:i386
sudo apt-get -y install libcairo2:i386
sudo apt-get -y install libfreetype6:i386
sudo apt-get -y install libfontconfig1:i386
sudo apt-get -y install libxcomposite1:i386
sudo apt-get -y install libasound2:i386
sudo apt-get -y install libxdamage1:i386
sudo apt-get -y install libxext6:i386
sudo apt-get -y install libxfixes3:i386
sudo apt-get -y install libnss3:i386
sudo apt-get -y install libnspr4:i386
sudo apt-get -y install libgconf-2-4:i386
sudo apt-get -y install libexpat1:i386
sudo apt-get -y install libdbus-1-3:i386
sudo apt-get -y install libudev0:i386
# on Linux 32 bit: download and unpack node-webkit, add it to PATH
wget http://dl.node-webkit.org/v${NODE_WEBKIT}/node-webkit-v${NODE_WEBKIT}-linux-ia32.tar.gz
tar xf node-webkit-v${NODE_WEBKIT}-linux-ia32.tar.gz
OLD_PATH="$PATH";
export PATH=$(pwd)/node-webkit-v${NODE_WEBKIT}-linux-ia32:$PATH
# on Linux 32 bit: ldd nw
ldd $(pwd)/node-webkit-v${NODE_WEBKIT}-linux-ia32/nw
# attempt node-pre-gyp package testpackage (if NODE_WEBKIT is not empty)
node-pre-gyp package testpackage publish --runtime=node-webkit --target=$NODE_WEBKIT
# on Linux 32 bit: erase used node-webkit, restore PATH
export PATH="$OLD_PATH"; rm -rf node-webkit-v${NODE_WEBKIT}-linux-ia32
'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment