-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
40 lines (40 loc) · 1.11 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
language: node_js
node_js:
- '10'
env:
global:
- DEV_IMAGE_NAME=luckjs/smartbin
- DEV_CONTAINER_NAME=smartbin.best_master
- DEV_VIRTUAL_HOST=smartbin.best
jobs:
include:
- stage: build
services:
- docker
script:
- docker build . -t $IMAGE_NAME
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker push $IMAGE_NAME
env: IMAGE_NAME=$DEV_IMAGE_NAME
- stage: deploy
before_deploy:
- openssl aes-256-cbc -K $encrypted_411d32e4d172_key -iv $encrypted_411d32e4d172_iv
-in .travis/id_rsa.enc -out .travis/id_rsa -d
- eval "$(ssh-agent -s)"
- cp .travis/id_rsa ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- ssh-add ~/.ssh/id_rsa
- chmod 700 ~/.ssh
- ssh-keyscan $HOST_IP > ~/.ssh/known_hosts
script: skip
env:
- IMAGE_NAME=$DEV_IMAGE_NAME
- CONTAINER_NAME=$DEV_CONTAINER_NAME
- VIRTUAL_HOST=$DEV_VIRTUAL_HOST
deploy:
- provider: script
skip_cleanup: true
script: bash .travis/deploy.sh $HOST_IP $DOCKER_PASSWORD $DOCKER_USERNAME $IMAGE_NAME
$CONTAINER_NAME
on:
branch: master