-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
50 lines (50 loc) · 1.53 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
language: node_js
sudo: true
addons:
apt:
sources:
- mysql-5.7-trusty
packages:
- mysql-server
- mysql-client
services:
- mysql
node_js:
- '9'
directories:
- node_modules
before_install:
- mkdir -p ~/.ssh/
- openssl aes-256-cbc -K $encrypted_eaa6087fa539_key -iv $encrypted_eaa6087fa539_iv
-in id_rsa.enc -out ~/.ssh/id_rsa -d
- chmod 600 ~/.ssh/id_rsa
- echo -e "Host 123.207.252.230 \n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- sudo mysql -e "use mysql; update user set authentication_string=PASSWORD('root') where User='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
- sudo mysql_upgrade -uroot -proot
- sudo service mysql restart
- mysql -uroot -proot -e 'CREATE DATABASE IF NOT EXISTS vote_test;'
install:
- npm install -g codecov
- npm install
before_script:
script:
- npm run ci
# - istanbul cover ./node_modules/mocha/bin/_mocha --reporter lcovonly -- -R spec
- codecov
after_success:
- tar -jcf egg.tar.bz2 * .*
- scp egg.tar.bz2 ubuntu@123.207.252.230:~/
- ssh ubuntu@123.207.252.230 'mkdir -p /usr/share/nginx/html/egg && mv ~/egg.tar.bz2
/usr/share/nginx/html/egg'
#- ssh ubuntu@123.207.252.230 'cd /usr/share/nginx/html/egg && tar -jxf egg.tar.bz2
# && rm -rf egg.tar.bz2'
#- ssh ubuntu@123.207.252.230 'cd /usr/share/nginx/html/egg && npm run stop'
#- ssh ubuntu@123.207.252.230 'cd /usr/share/nginx/html/egg && npm run start'
# - ssh ubuntu@123.207.252.230 'pm2 show vote'
after_script:
branches:
only:
- master
env:
global:
- CODECOV_TOKEN="a7b5f136-6a3e-4e2f-afc4-4f3082cec1b9"