forked from linuxluigi/flask-meetup-data-scraper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
70 lines (62 loc) · 2.44 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
dist: bionic
language: python
os:
- linux
services:
- docker
cache:
pip: true
directories:
- $HOME/.cache/pip
addons:
apt:
packages:
- python3-pip
- python3-setuptools
hosts:
- meetup-search.de
before_script:
# build docker images development
- sudo docker-compose -f local.yml build
# build docker images production
- cp -r .envs/.local/ .envs/.production/
- printf "\nFLASK_CONFIGURATION=/app/config/production.py" >> .envs/.production/.flask
- printf "\nFLASK_ENV=production" >> .envs/.production/.flask
- sudo docker-compose -f production.yml build
# add test groups for group import command
- cp compose/local/flask/meetup_groups/test-groups.json meetup_groups/test-groups.json
# start production server
# - sudo docker-compose -f production.yml up -d
install:
# install docker-compose
- pip3 install docker-compose wheel
script:
# test production setup
# - chmod +x integration_tests.sh
# - ./integration_tests.sh
# stop production server
# - sudo docker-compose -f production.yml stop
# migrate models
- sudo docker-compose -f local.yml run flask flask migrate_models
- sleep 1
# test get_groups with a valid & one invalid group
- sudo docker-compose -f local.yml run flask flask get_groups /app/compose/local/flask/meetup_groups
- sleep 1
# test get_group sandbox -> should add 0 events, because there already in elasticsearch
- sudo docker-compose -f local.yml run flask flask get_group --sandbox True
- sudo docker-compose -f local.yml run flask flask get_group Meetup-API-Testing
# load all meetup zips from saxony
- sudo docker-compose -f local.yml run flask flask load_zip_codes 50.1713271 51.6848692 11.872254 15.0418087
# todo enable load groups when api account is integrated!
# load groups from meetup for all saved meetup zip locations
# - sudo docker-compose -f local.yml run flask flask load_groups --country DE --load_events False
# test update_groups
- sudo docker-compose -f local.yml run flask flask update_groups
# run typing check with mypy
- sudo docker-compose -f local.yml run flask coverage run -m mypy /app
# run tests
- sudo docker-compose -f local.yml run flask coverage run -m pytest
# code coverage upload to codacy
- printf "\nCODACY_PROJECT_TOKEN=$CODACY_PROJECT_TOKEN" >> .envs/.local/.flask
- sudo docker-compose -f local.yml run flask coverage xml
- sudo docker-compose -f local.yml run flask python-codacy-coverage -r coverage.xml