forked from gramener/gramex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
106 lines (99 loc) · 3.21 KB
/
.gitlab-ci.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
# Documentation on starting services:
# http://doc.gitlab.com/ce/ci/services/postgres.html
# http://doc.gitlab.com/ce/ci/services/mysql.html
services:
- postgres:latest
- mysql:latest
- redis:latest
variables:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
MYSQL_DATABASE: test_datahandler
MYSQL_USER: root
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
# Define variables for nosetests pointing to the database servers
# See http://doc.gitlab.com/ee/ci/docker/using_docker_images.html
POSTGRES_SERVER: postgres
MYSQL_SERVER: mysql
REDIS_SERVER: redis
# Perform these checks on every commit
validate:
tags: [py3]
script:
- eclint check '**/*.html' '**/*.js' '**/*.css' '**/*.yaml' '**/*.md'
- flake8
- eslint gramex/apps
- htmllint
- pip install -e .
- pip install gramexenterprise
- gramex license accept
- python setup.py nosetests
- bandit gramex --recursive --format csv || true # Just run bandit as a warning
- pytest -v gramex/apps/guide/test/gramextest.yaml
- gramex --listen.port=1234 > gramex.log 2>&1 &
- sleep 10
- pytest tests/gramextest.yaml
- cat gramex.log
- kill %1
# Test the dev and master branches on Python 3 as well
validate-py2:
only: [dev, master]
tags: [py2]
script:
- flake8 # Check flake8 errors for Python 2
- pip install -e .
- pip install gramexenterprise
- gramex license accept
- python setup.py nosetests
- pytest -v gramex/apps/guide/test/gramextest.yaml
- gramex --listen.port=1234 > gramex.log 2>&1 &
- sleep 10
- pytest tests/gramextest.yaml
- cat gramex.log
- kill %1
# Deploy the guide from dev, master, doc-* branches gramener.com
deploy-guide:
only: [dev, master, /^doc-.*$/]
script:
- rsync -avzP gramex/apps/guide [email protected]:/mnt/gramener/apps/v1/
- 'ssh -t [email protected] "
/mnt/gramener/anaconda/bin/gramex setup /mnt/gramener/apps/v1/guide;
/mnt/gramener/anaconda/bin/gramex setup ui;
"'
# Deploy the dev / master branches on gramener.com
deploy-gramener:
only: [dev, master]
script:
- 'ssh -t [email protected] "
cd /mnt/gramener/apps/gramex;
git checkout -- .;
git pull;
rm -rf /mnt/gramener/apps/v1/guide /mnt/gramener/apps/v1/gramex-update;
cp -R /mnt/gramener/apps/gramex/gramex/apps/guide /mnt/gramener/apps/v1/;
cp -R /mnt/gramener/apps/gramex/gramex/apps/update /mnt/gramener/apps/v1/gramex-update;
/mnt/gramener/anaconda/bin/gramex setup /mnt/gramener/apps/v1/guide;
/mnt/gramener/anaconda/bin/gramex setup ui;
"'
# Deploy the master branch additionally on uat & demo servers
deploy-uat-demo:
only: [master]
script:
- 'ssh -t [email protected] "
cd ~/gramex;
git checkout -- .;
git pull;
pip install --verbose -e .;
pip install gramexenterprise;
gramex setup --all;
gramex license accept;
"'
- 'ssh -t [email protected] "
cd /mnt/data/apps/gramex/gramex/;
git checkout -- .;
git pull;
pip install --verbose -e .;
pip install gramexenterprise;
gramex setup --all;
gramex license accept;
"'