Skip to content

Instantly share code, notes, and snippets.

@Timshel
Created July 18, 2013 12:50
Show Gist options
  • Save Timshel/6029041 to your computer and use it in GitHub Desktop.
Save Timshel/6029041 to your computer and use it in GitHub Desktop.
Jenkins
#!/bin/bash
export PATH=/usr/share/tomcat7/play/play-2.1.1:/usr/local/bin:$PATH
export PHANTOMJS_BIN=/usr/share/tomcat7/phantomjs/phantomjs-1.9.1-linux-x86_64/bin/phantomjs
moHash=$(cat project/Build.scala | grep -e "val libVersion" | sed -e "s/.*\"\(.*\)\".*/\1/g")
# Setup env
mkdir test_out
# Configure the MO instance
git clone git@bitbucket.org:zenexity/imnh-mo.git
cd imnh-mo && pwd
git reset --hard $moHash
JAVA_OPTS="-Xms256m -Xmx512m" play clean stage
# Spawn a child process:
(target/start -Dhttp.port=9001 > ../test_out/mo.log) & pidMo=$!
git reset --hard $moHash
cd .. && pwd
# Configure the EA instance
JAVA_OPTS="-Xms256m -Xmx512m" play clean test stage -Dconfig.file=conf/ci.conf
# Spawn a child process:
(target/start -Dconfig.file=conf/ci.conf > test_out/ea.log) & pidEa=$!
# Do the test
grunt test
kill -9 $pidMo && rm imnh-mo/RUNNING_PID
kill -9 $pidEa && rm RUNNING_PID
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment