This repository has been archived by the owner on May 20, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
160 lines (149 loc) · 4.53 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
os: linux
dist: xenial
language: python
python:
- "3.6"
script: skip
env:
NGROK_TOKEN: 1RER6BUC3QNNwYWY5LcIBjrv3A8_24QccmopTEQJGMErG9uzw
jobs:
include:
- stage: test
#run unit tests for render
- language: python
env:
TEMPLATES_DIR: inputs/templates
VARS_DIR: inputs/variables
SCRIPTS_DIR: tests
ISOLATED: true
before_install:
- pip3 install -r requirements.txt
- pip3 install coveralls
before_script:
- py.test $SCRIPTS_DIR/render_test.py --cov=rest/api/jinja2
script:
- python3 -m unittest discover . "render_test.py"
after_script:
- coveralls
#run agent tests in docker
- language: python
services: docker
env:
SCRIPTS_DIR: tests
ISOLATED: true
before_install:
- docker build -t estuaryoss/agent:latest -f Dockerfile .
- chmod +x ngrok.sh
- docker run
-d
-p 8080:8080
--name estuary-agent
estuaryoss/agent:latest
script:
- docker exec estuary-agent python3 -m unittest discover /scripts/tests/rest *_test.py
- docker exec estuary-agent python3 -m unittest discover /scripts/ "render_test.py"
#run integration and unit tests on binary. exec with pyinstaller
- language: python
services: docker
env:
ISOLATED: true
NGROK_TOKEN: 1RER6BUC3QNNwYWY5LcIBjrv3A8_24QccmopTEQJGMErG9uzw
SKIP_ON_VM: true
before_script:
- pip3 install -r requirements.txt
- pyinstaller --onefile main_flask.py
- pyinstaller --onefile start.py
- ls -lrt dist
- cp dist/main_flask main-linux
- \cp dist/start start.py
- chmod +x main-linux
- sudo chown -R travis:travis inputs
- ls -lrt
script:
- ./main-linux > /dev/null 2>&1 &
- ls -lrt
- sleep 5
# - ./ngrok.sh
# - sleep 3600
- python3 -m unittest discover tests/rest "*_test.py"
- python3 -m unittest discover tests/unit "*_test.py"
- ls -lrt /tmp
- ps -ef
#run executable tests - centos docker
- language: python
services: docker
env:
ISOLATED: true
NGROK_TOKEN: 1RER6BUC3QNNwYWY5LcIBjrv3A8_24QccmopTEQJGMErG9uzw
SKIP_ON_VM: true
SKIP_ON_DOCKER: true
before_script:
- pip3 install -r requirements.txt
- pyinstaller --onefile main_flask.py
- pyinstaller --onefile start.py
- ls -lrt dist
- cp dist/main_flask main-linux
- cp dist/start start.py-linux
script:
- docker build -t estuaryoss/agent-centos:latest -f Dockerfile_centos .
- docker run
-d
-p 8080:8080
--name estuary-agent-centos
estuaryoss/agent-centos:latest
- sleep 5
- docker logs estuary-agent-centos
# - ./ngrok.sh
# - sleep 3600
- python3 -m unittest discover tests/rest "*_test.py"
- language: python
services:
- docker
env:
SCRIPTS_DIR: tests
DOCKER_SCRIPTS_DIR: /scripts
ISOLATED: true
before_script:
- docker login -u "$DOCKERHUB_USERNAME" -p "$DOCKERHUB_TOKEN"
- docker build -t estuaryoss/agent:latest -f Dockerfile .
- docker tag estuaryoss/agent:latest dinutac/estuary-agent:latest # <-- remove this when migrating
script:
#run eureka registration tests
- docker-compose up -d
- sleep 40
- docker ps -a
- docker exec estuary-agent python3 -m unittest discover $DOCKER_SCRIPTS_DIR/tests/rest_eureka "*_test.py"
- docker-compose down -v
- stage: deploy
services: docker
before_deploy:
- pip3 install -r requirements.txt
- pyinstaller --onefile main_flask.py
- pyinstaller --onefile start.py
- ls -lrt dist
- cp dist/main_flask main-linux
- \cp dist/start start.py-linux
- ls -lrt
- rm -rf dist
- rm -rf build
- chmod +x *.sh
deploy:
- provider: releases
token: $GITHUB_TOKEN
file:
- "main-linux"
- "start.py-linux"
skip_cleanup: true
on:
tags: true
- provider: script
script: bash docker_push_tag.sh
skip_cleanup: true
on:
tags: true
- provider: script
script: bash docker_push_master.sh
skip_cleanup: true
on:
tags: false
branch: master