-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
34 lines (34 loc) · 1.16 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
sudo: required
language: node_js
node_js:
- 13.1.0
before_script:
- openssl aes-256-cbc -K $encrypted_3cd44c983b33_key -iv $encrypted_3cd44c983b33_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:
- yarn
stages:
- name: Build
- name: DeployTest
if: branch = cicd AND type=push OR branch=Tien_webpack
- name: DeployProduct
if: branch = master AND type=push
jobs:
include:
- stage: Build
script:
- CI=false SKIP_PREFLIGHT_CHECK=true yarn build
- ssh -q -p ${PORT_SSH} ${USER}@${HOST} "/bin/mkdir -p /home/${USER}/build/ebanking"
- rsync -a -e "ssh -p ${PORT_SSH}" ./ ${USER}@${HOST}:/home/${USER}/build/ebanking/ --delete
--exclude="node_modules"
- stage: DeployTest
script:
- ssh -q -p ${PORT_SSH} ${USER}@${HOST} "cp -R --remove-destination /home/${USER}/build/ebanking/build/*
/var/www/ebankingtest.kienthuc24h.com"
- stage: DeployProduct
script:
- ssh -q -p ${PORT_SSH} ${USER}@${HOST} "cp -R --remove-destination /home/${USER}/build/ebanking/build/*
/var/www/ebanking.kienthuc24h.com"