Skip to content

Instantly share code, notes, and snippets.

@bitdivision
Created November 26, 2014 09:47
Show Gist options
  • Save bitdivision/8ff3114f7247feeba729 to your computer and use it in GitHub Desktop.
Save bitdivision/8ff3114f7247feeba729 to your computer and use it in GitHub Desktop.
#Set up a Node.js environment
language: node_js
node_js:
- '0.10'
env:
global:
secure: "ecVAPtm1YNT4USYEbG5lnLnQ9pBWSDKHdjhUbQSk35UvunixLOvU/oeHzWqTIoDxEFKf0HehSXW9tM569bsBZth9O7WBwJAhSNkUrPVF4WDT1p+zsuakSZuZTAEVCqbeL+pPdVR968ML1UKP0hLgTbgDvM9HpyM4YQxVAOXfskI="
#Include the Sauce Connect plugin to allow tunneling.
addons:
sauce_connect: true
before_install:
#Decrypt the private key used to access the deployment repository on github
- openssl aes-256-cbc -K $encrypted_b7a3a86a6284_key -iv $encrypted_b7a3a86a6284_iv
-in id_ci_github.enc -out ~/.ssh/id_ci_github -d
install:
- sudo apt-get update -qq
- sudo apt-get install -y graphicsmagick
- cd ..
# Get the regression test code we'll be using along with the images
- git clone https://github.com/ZoetropeImaging/regression-tests.git
- cd regression-tests
# Clone this repo again inside the regression test folder
- git clone --depth=50 --branch=$TRAVIS_BRANCH git://github.com/ZoetropeImaging/zoetrope-jquery.git
- cd zoetrope-jquery
# Checkout the particular commit Travis wants to test
- git checkout -qf $TRAVIS_COMMIT
- cd ..
before_script:
- npm install
- cd zoetrope-jquery
- npm install
- gulp fetch
- gulp
- cd ..
# Start an http server which Sauce Labs will connect to through the tunnel
- http-server -p 8888 zoetrope-jquery/dist &
- sleep 3
script:
- cd tests
# Run the tests
- protractor testSuite.conf.js
after_success:
# If the tests pass then run the script to deploy (assuming we're on production branch)
- cd ..
- chmod +x zoetrope-jquery/travis_deploy_zoetrope.sh
- if [[ "$TRAVIS_BRANCH" == "v3" ]]; then bash -x zoetrope-jquery/travis_deploy_zoetrope.sh; fi
after_failure:
# If the tests fail then connect to our server and upload the images we captured through Sauce Labs
- chmod 600 ~/.ssh/id_ci_github
- ssh -i ~/.ssh/id_ci_github -o "StrictHostKeyChecking no" $TEST_IMAGES_SERVER -p2223 'mkdir' $TRAVIS_COMMIT
- scp -i ~/.ssh/id_ci_github -P2223 -rp /tmp/screen* $TEST_IMAGES_SERVER:~/$TRAVIS_COMMIT
notifications:
# Notify us of the test result through Slack,
slack:
secure: Z0vtEJkHu7iDgSXMsVbsTmcn+N1GzBM6b2Ijx16DY2BCitt9h3tiSKUgazd3ULP6/9s/bKd0ZzkTIFTmsBszF7kh12uGrs2zB9GP20zoJiQ+e82toWkp9nV6Wx21f6bLiN+7ejiJqG3iV+2SUVyWvYchm4acu63kv1bVHxDuATI=
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment