-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.travis.yml
45 lines (35 loc) · 1.17 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
sudo: required
language: node_js
node_js:
- 13.1.0
before_script:
- openssl aes-256-cbc -K $encrypted_d3c5acc61ede_key -iv $encrypted_d3c5acc61ede_iv -in deploy_rsa.enc -out deploy_rsa -d
- eval "$(ssh-agent -s)"
- chmod 600 deploy_rsa
- ssh-add deploy_rsa
- echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
install:
- npm i
stages:
- name: Build
# - name: TestCoverage
- name: DeployKaraoke
if: branch = master AND type=push
- name: DeployKaraokeTest
if: branch = cicd AND type=push
jobs:
include:
- stage: Build
script:
- npm run build
- ssh -q -p ${PORT_SSH} ${USER}@${HOST} "/bin/mkdir -p /home/${USER}/build/karaoke-backend"
- rsync -a -e "ssh -p ${PORT_SSH}" ./ ${USER}@${HOST}:/home/${USER}/build/karaoke-backend/ --delete --exclude="node_modules"
# - stage: TestCoverage
# script:
# - npm run test:ci
- stage: DeployKaraokeTest
script:
- ssh -q -p ${PORT_SSH} ${USER}@${HOST} "/home/${USER}/pm2/backend_karaoke_test/start.sh"
- stage: DeployKaraoke
script:
- ssh -q -p ${PORT_SSH} ${USER}@${HOST} "/home/${USER}/pm2/backend_karaoke/start.sh"