-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
128 lines (114 loc) · 3.48 KB
/
.travis.yml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
language: node_js
node_js:
- '4.4'
services:
- docker
cache:
directories:
- node_modules
- software/owh/server/node_modules
- software/owh/client/node_modules
- bower_components
- software/owh/client/bower_components
addons:
code_climate:
repo_token: 93b5f633a4ddcc18c05836556de9a242e774a129479002530b93aa824a6d11ef
env:
global:
- AWS_ACCESS_KEY_ID=$OWH_ACCESS_KEY
- AWS_SECRET_ACCESS_KEY=$OWH_ACCESS_SECRET
- NODE_ENV=test
before_install:
- docker info
- mkdir -p .owh/logs
- openssl aes-256-cbc -K $encrypted_24a8a70e72ba_key -iv $encrypted_24a8a70e72ba_iv -in .owh/owh-config.yaml.enc -out .owh/owh-config.yaml -d
- pip install awscli
- export PATH=$PATH:$HOME/.local/bin
install:
- cd software/owh/server
- npm install
- npm install --dev
- cd ../client
- npm install
- npm install --dev
- npm install -g nodemon
- npm install -g istanbul
- npm install -g codeclimate-test-reporter
- npm install -g lcov-result-merger
before_script:
- sleep 10
- curl http://54.242.94.197/esdev # To verify ElasticSearch running
- curl http://54.165.91.131:7777/questions?d=yrbss # check connection to YRBS service
- java -version
- echo $JAVA_HOME
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm start > /dev/null &
- ./node_modules/protractor/bin/webdriver-manager update
- sleep 1 #give server time to start
language: java
jdk:
- oraclejdk8
script:
- npm run-script test-single-run
- ls
- ls coverage
- ls 'coverage/PhantomJS 2.1.1 (Linux 0.0.0)'
- cd ../server
- istanbul cover node_modules/mocha/bin/_mocha -- -R spec --recursive test
- npm start > /dev/null &
- sleep 10
- cd ../client
# Disabling E2E tests for now
# - ./node_modules/.bin/protractor test/e2e-tests/protractor.conf.js --browser=firefox
after_success:
- cd ..
- lcov-result-merger './**/lcov.info' 'merged-lcov.info'
- codeclimate-test-reporter < "merged-lcov.info"
before_deploy:
- cd $TRAVIS_BUILD_DIR/software/owh
# Dealing with paths that fight each other... start the nasty bit...
- cp -R $TRAVIS_BUILD_DIR/deployment/* $TRAVIS_BUILD_DIR/software/owh
# End the nasty bit.
- aws s3 sync s3://owh-config-dev $TRAVIS_BUILD_DIR/software/owh
- mkdir -p $TRAVIS_BUILD_DIR/software/owh/.owh/logs
- docker-compose up -d
- docker-compose build
- docker images
- mkdir -p dpl_tmp
- mkdir -p dpl_cd_upload
- docker save owh_web | gzip -c > dpl_tmp/owh_web.tar.gz
- cp $TRAVIS_BUILD_DIR/deployment/appspec.yml dpl_tmp/appspec.yml
- cp $TRAVIS_BUILD_DIR/deployment/docker-compose-deploy.yml dpl_tmp/docker-compose.yml
- cp $TRAVIS_BUILD_DIR/deployment/Dockerfile dpl_tmp/
- cp -R $TRAVIS_BUILD_DIR/deployment/scripts dpl_tmp/scripts
- cd dpl_tmp
- zip -r owh-${TRAVIS_BRANCH}-${TRAVIS_BUILD_NUMBER}.zip *
- ls
- cd ..
- mv dpl_tmp/owh-${TRAVIS_BRANCH}-${TRAVIS_BUILD_NUMBER}.zip dpl_cd_upload/
- ls dpl_tmp
- rm -rf dpl_tmp
deploy:
- provider: s3
access_key_id: $OWH_ACCESS_KEY
secret_access_key: $OWH_ACCESS_SECRET
local_dir: dpl_cd_upload
skip_cleanup: true
on: &2
repo: semanticbits/owh-ds
branch:
- develop
# - release (TBD)
bucket: sb-owh-deployment
- provider: codedeploy
access_key_id: $OWH_ACCESS_KEY
secret_access_key: $OWH_ACCESS_SECRET
bucket: sb-owh-deployment
key: owh-$TRAVIS_BRANCH-$TRAVIS_BUILD_NUMBER.zip
bundle_type: zip
application: OwhDev
deployment_group: $TRAVIS_BRANCH
on: *2
after_script:
- kill -9 $(fuser -n tcp 3000 2> /dev/null)