-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_script
More file actions
68 lines (54 loc) · 1.59 KB
/
build_script
File metadata and controls
68 lines (54 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
export DISPLAY=:1
Xvfb :1 &
#
# Fetch node and testacular if we don't have it already
#
node_version=v0.10.16
install_name=node-$node_version-linux-x64
node_home=$PWD/$install_name
#if [ ! -e $install_name.tar.gz ]
#then
wget http://nodejs.org/dist/$node_version/$install_name.tar.gz
tar xf $install_name.tar.gz
$node_home/bin/npm install -g phantomjs
$node_home/bin/npm install -g karma
$node_home/bin/npm install -g karma-junit-reporter
$node_home/bin/npm install -g karma-jasmine
$node_home/bin/npm install -g karma-ng-scenario
$node_home/bin/npm install -g mocha
#fi
#
# run the Angular.js tests (using a browser on the build server)
#
export PATH=$PATH:$node_home/bin
export PHANTOMJS_BIN=$node_home/bin/phantomjs
scripts/test.sh --single-run --browsers="Chrome,Firefox" --reporters="dots,junit" --no-colors
#
# run the Angular.js e2e tests (this requires a server too)
#
node scripts/web-server.js > /dev/null &
NODE_PID=$!
scripts/e2e-test.sh --single-run --browsers="Chrome,Firefox" --reporters="dots,junit" --no-colors
kill -s TERM $NODE_PID
#
# package the app for the CloudBees node.js stack (deployer picks it up)
#
cd app
if [ ! -d test ]
then mkdir test
fi
cat > "test/test.js" << EOF
var app = require('../app'), http = require('http'), request = require('supertest'), assert = require('assert');
describe('GET /index.html', function(){
it('get index.html', function(done){
request(app)
.get('/index.html')
.expect(200, done);
});
});
EOF
npm install
npm test
mkdir -p ../target
rm -rf ../target/app.zip
zip -r ../target/app.zip *