-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
42 lines (42 loc) · 1.24 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
language: node_js
node_js:
- '14.15.3'
env:
global:
- CMS_IMAGE_NAME=luckjs/luck-cms
- CMS_CONTAINER_NAME=luck-cms_master
- DB_CONTAINER_NAME=luck-cms-db_master
- VIRTUAL_HOST=cms.luck.org.pl
jobs:
include:
- stage: build
services:
- docker
script:
- docker build . -t $CMS_IMAGE_NAME
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker push $CMS_IMAGE_NAME
env: CMS_IMAGE_NAME=$CMS_IMAGE_NAME
- stage: deploy
before_deploy:
- openssl aes-256-cbc -K $encrypted_45457958fdd0_key -iv $encrypted_45457958fdd0_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:
- CMS_IMAGE_NAME=$CMS_IMAGE_NAME
- CMS_CONTAINER_NAME=$CMS_CONTAINER_NAME
- DB_CONTAINER_NAME=$DB_CONTAINER_NAME
- VIRTUAL_HOST=$VIRTUAL_HOST
deploy:
- provider: script
skip_cleanup: true
script: bash .travis/deploy.sh $HOST_IP $DOCKER_PASSWORD $DOCKER_USERNAME $CMS_IMAGE_NAME
$CMS_CONTAINER_NAME $DB_CONTAINER_NAME
on:
branch: master