This repository has been archived by the owner on Jan 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
96 lines (84 loc) · 2.41 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
stages:
- test
- package
- rollout
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
cache:
key: pipcache
paths:
- .cache/pip
tests:
stage: test
image: python:3.12
before_script:
- apt update && apt install -y libgdal-dev libsqlite3-mod-spatialite
- pip install --upgrade -r requirements.txt
script:
- ./manage.py test --testrunner "xmlrunner.extra.djangotestrunner.XMLTestRunner"
artifacts:
when: always
reports:
junit: TEST-*.xml
migrations:
stage: test
image: python:3.12
before_script:
- apt update && apt install -y libgdal-dev libsqlite3-mod-spatialite
- pip install --upgrade -r requirements.txt
script:
- ./manage.py makemigrations --check --dry-run
python-typing:
stage: test
image: python:3.12
before_script:
- apt update && apt install -y libgdal-dev libsqlite3-mod-spatialite
- pip install --upgrade -r requirements.txt
- pip install --upgrade mypy
script:
- mypy --install-types --non-interactive championship invoicing oracle decklists
python-format:
stage: test
image: python:3.12
before_script:
- apt update && apt install -y libgdal-dev libsqlite3-mod-spatialite
- pip install -r requirements.txt
- pip install pre-commit
script:
- pre-commit run --all-files
web-format:
stage: test
image: node:19
before_script:
- npm install prettier
script:
- npx prettier --check static
build-docker:
stage: package
only:
refs:
- master
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo $CI_COMMIT_SHORT_SHA > commit_sha.txt
- echo "{\"auths\":{\"https://index.docker.io/v1/\":{\"auth\":\"$CI_HUB_SECRET\"}}}" > /kaniko/.docker/config.json
- cat /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination antoinealb/league:latest --single-snapshot
restart-service:
stage: rollout
only:
refs:
- master
tags:
- infra
script:
- sudo /usr/bin/docker pull antoinealb/league:latest
- sudo /bin/systemctl restart league_playground.service
- sleep 30
- sudo /usr/bin/docker exec league_playground.service ./manage.py migrate --no-input
- sudo /bin/systemctl restart league_playground_eu.service
- sudo /bin/systemctl restart league.service
- sleep 30
- sudo /usr/bin/docker exec league.service ./manage.py migrate --no-input