-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
94 lines (84 loc) · 2.08 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
before_script:
- id
- pwd
- ruby -v
- python3 --version
- if [ ! -e venv/bin/activate ] ; then virtualenv -p $(which python3) venv ; fi
- source venv/bin/activate
- bundle install --jobs $(nproc) --path venv/ruby
- pip install --upgrade pip
- pip install -r requirements.txt
- pip install -r requirements-test.txt
- cp -f members/settings.py.example members/settings.py
- echo LDAP_SERVER_URI = \'ldap://$LDAP_TEST_URL\' > members/localSettings.py
- echo LDAP_AUTHENTICATION_DN = \'$LDAP_TEST_AUTH_DN\' >> members/localSettings.py
- echo LDAP_AUTHENTICATION_PASSWORD = \'$LDAP_TEST_AUTH_PWD\' >> members/localSettings.py
- echo LDAP_MANAGEMENT_DN = \'$LDAP_TEST_MGMT_DN\' >> members/localSettings.py
- echo LDAP_MANAGEMENT_PASSWORD = \'$LDAP_TEST_MGMT_PWD\' >> members/localSettings.py
stages:
- build
- test
- deploy
cache:
paths:
- venv/
db-migrations:
stage: build
except:
- master
script:
- python manage.py makemigrations
accounts-test:
stage: test
except:
- master
script:
- python manage.py test accounts
network-test:
stage: test
except:
- master
script:
- python manage.py test network
cleaning-test:
stage: test
except:
- master
script:
- python manage.py test cleaning
code-coverage-report:
stage: test
except:
- master
script:
- coverage run manage.py test
- coverage report --include="accounts/*,network/*,cleaning/*"
pep8-syntax:
stage: test
except:
- master
script:
- flake8
deploy_dev:
stage: deploy
environment:
name: dev
url: https://members-dev.atilla.org
only:
- dev
script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_DEV_PRIVATE_KEY")
- ssh -t [email protected] "cd members/misc; ./deploy.sh dev"
deploy_prod:
stage: deploy
environment:
name: production
url: https://members.atilla.org
only:
- master
when: manual
script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_MASTER_PRIVATE_KEY")
- ssh -t [email protected] "cd members/misc; ./deploy.sh master"