Skip to content

Instantly share code, notes, and snippets.

@michaelneale
Created May 9, 2014 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaelneale/547b30f7f851450b9687 to your computer and use it in GitHub Desktop.
Save michaelneale/547b30f7f851450b9687 to your computer and use it in GitHub Desktop.
script for meteor build/test
export DISPLAY=:1
Xvfb :1 &
#
# Fetch and install the dependencies
#
node_version=v0.10.26
install_name=node-$node_version-linux-x64
node_home=$PWD/$install_name
if [ ! -e $install_name.tar.gz ]
then
wget -nv http://nodejs.org/dist/$node_version/$install_name.tar.gz
tar xf $install_name.tar.gz
wget https://warehouse.meteor.com/bootstrap/0.8.1.1/meteor-bootstrap-Linux_x86_64.tar.gz
tar xf meteor-bootstrap-Linux_x86_64.tar.gz
cd tests
wget -nv https://s3.amazonaws.com/cloudbees-downloads/clickstart/webspecter.tar.gz
tar xf webspecter.tar.gz
$node_home/bin/npm install phantomjs
fi
export PATH=$WORKSPACE/.meteor:$PATH
meteor --version
#
# run the Integration tests (this requires a server running, and selenium wd)
#
# Start meteor app
cd $WORKSPACE/todos
meteor &
METEOR_PID=$!
sleep 5
# run integration tests and shutdown
cd $WORKSPACE/tests
PATH=$PATH:node_modules/phantomjs/bin
PATH=$PATH:$node_home/bin
PATH=$PATH:webspecter/bin
webspecter -R xunit integration.coffee > $WORKSPACE/test.out.xml
kill -s TERM $METEOR_PID
#
# Meteor bundle and rezip for cloudbees
#
cd $WORKSPACE
rm -rf bundle bundle.tar.gz
cd todos
meteor bundle ../bundle.tar.gz
cd $WORKSPACE
tar xf bundle.tar.gz
cd bundle
sed -i -e 's/MONGO_URL/MONGOHQ_URL_METEOR/g' server/server.js
rm -rf ../target
mkdir -p ../target
rm -rf ../target/app.zip
zip -rq ../target/app.zip *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment