-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
30 lines (30 loc) · 880 Bytes
/
.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
language: minimal
env:
global:
- IMAGE_NAME=gut/webdocs_stable
- SERVER_IP=rack-monster.ds.pg.gda.pl
- SERVER_PORT=49751
- CI_USER=deploy
- KEY_FILE=deploy_key
- CONTAINER_NAME=webdoc
branches:
only:
- master
services:
- docker
before_install:
- openssl aes-256-cbc -K $encrypted_5704401eb47b_key -iv $encrypted_5704401eb47b_iv -in secrets.tar.enc -out secrets.tar -d
- tar xvf secrets.tar
- eval "$(ssh-agent -s)"
- chmod 600 ./$KEY_FILE
- echo -e "Host $SERVER_IP\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
- ssh-add ./$KEY_FILE
script:
- cd WebDocs
- mv ../cert.pfx ./cert.pfx
- docker build -t $IMAGE_NAME .
- docker save -o ../temp.tar $IMAGE_NAME
- cd ../
- scp -i ./$KEY_FILE -P $SERVER_PORT ./temp.tar $CI_USER@$SERVER_IP:~/temp.tar
- ssh -T -i ./$KEY_FILE -p $SERVER_PORT $CI_USER@$SERVER_IP "bash -s" < ops/deploy.sh
$CONTAINER_NAME $IMAGE_NAME