Skip to content

Commit fafe40c

Browse files
authored
Merge pull request #23 from optimizely/josh.wang/jenkins/start_devel_test_script
Jenkins CI Test Script
2 parents cb3ce5f + 2991427 commit fafe40c

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ npm-debug.log
55
node_modules
66
dist
77
coverage/
8+
Scripts
89

910
.idea/*

Scripts/ci_unit_tests.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
# cannot use `set -e` because it is incompatible with nvm
3+
4+
# download nvm and load it
5+
export NVM_DIR="`pwd`/.nvm" # truly local nvm install not needing sudo
6+
mkdir -p $NVM_DIR
7+
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
8+
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
9+
10+
function run_tests () {
11+
echo "Installing node" $1
12+
nvm install $1
13+
nvm exec $1 npm install
14+
response=$?
15+
if [[ $response != 0 ]]; then exit $response; fi
16+
nvm exec $1 npm test
17+
response=$?
18+
if [[ $response != 0 ]]; then exit $response; fi
19+
}
20+
21+
# install node 5; run tests
22+
run_tests 5
23+
24+
# install node 0.10; run tests
25+
run_tests 0.10
26+
27+
# install node; run tests
28+
run_tests node

0 commit comments

Comments
 (0)