-
Notifications
You must be signed in to change notification settings - Fork 14
/
.gitlab-ci.yml
executable file
·79 lines (66 loc) · 1.51 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
stages:
- test
- deploy
before_script:
- source .envrc
unit-tests:
stage: test
retry: 2 # solves frequent filesystem sync issues
script:
- green -vvv --quiet-stdout --run-coverage
type-check:
stage: test
script:
- mypy -p qaboard --ignore-missing-imports
lint:
stage: test
script:
- flake8 backend qaboard --count --select=E9,F63,F7,F82 --show-source --statistics
deploy:qa:
stage: deploy
only:
- master
script:
- pip install .
variables:
DOCKER_IMAGE: qaboard
# https://docs.gitlab.com/ee/ci/yaml/#git-clean-flags
GIT_CLEAN_FLAGS: -ffdx --exclude=webapp/node_modules/
# CI for the web application and the backend
# TODO: enable it, make it work...
# backend:tests:
# stage: test
# script:
# - cd backend
# # we only check that the syntax is correct
# - pip install .
# webapp:tests:
# stage: test
# script:
# - cd webapp
# - npm ci
# # - npm test
# we deploy to the "qa" host.
# Internally we need to deal with proxy issues, tcsh as default shell, etc...
.deploy: &deploy
stage: deploy
script:
- ssh $DOCKER_HOST "bash -c \"cd $(pwd) && source .envrc && ./at-sirc-before-up.py && docker-compose -f docker-compose.yml -f production.yml -f sirc.yml up -d --build\""
deploy:production:
<<: *deploy
environment:
name: production
url: https://qa
only:
- master
when: manual
deploy:staging:
<<: *deploy
variables:
DOCKER_HOST: qa
CI_ENVIRONMENT_SLUG: ""
environment:
name: staging
url: http://qa:9000
only:
- master