-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
113 lines (106 loc) · 2.31 KB
/
.gitlab-ci.yml
File metadata and controls
113 lines (106 loc) · 2.31 KB
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
107
108
109
110
111
112
113
stages:
- lint
- test
- build
- deploy
lint_frontend:
stage: lint
only:
- main
- dev
- merge_requests
- web
image: node
script:
- cd frontend
- npm install
- npm run lint
lint_backend:
stage: lint
only:
- main
- dev
- merge_requests
- web
image: registry.gitlab.com/pipeline-components/black:latest
script:
- black --check --verbose -- .
playwright_tests:
stage: test
only:
- main
- dev
- e2e
- merge_requests
image: node:lts
before_script:
# Install Python and pip
- apt-get update -y
- apt-get install -y python3 python3-pip python3-venv
# Set up backend Python environment
- cd backend
- python3 -m venv .env
- source .env/bin/activate
- pip install -r requirements.txt
- cd ../
# Set up frontend Node.js environment
- cd frontend
- npm install -g pnpm
- pnpm install
- cd ../
# Set up e2e-tests environment
- cd e2e-tests
- pnpm install
- pnpm exec playwright install chromium --with-deps
script:
- pnpm exec playwright test
artifacts:
when: always
paths:
- e2e-tests/playwright-report/
expire_in: 30 days
timeout: 60m
build:
stage: build
only:
- main
image: docker:latest
services:
- docker:dind
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
parallel:
matrix:
- COMPONENT: [frontend, backend]
script:
- docker build -t $CI_REGISTRY/sbibauw/languagelab:$COMPONENT $COMPONENT
- docker push $CI_REGISTRY/sbibauw/languagelab:$COMPONENT
docker_deploy:
stage: deploy
only:
- main
image: alpine:latest
script:
- echo "/mnt/data/languagelab/repo/scripts/update.sh" > /mnt/pipeline
build-dev:
stage: build
only:
- dev
image: docker:latest
services:
- docker:dind
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
parallel:
matrix:
- COMPONENT: [frontend, backend]
script:
- docker build -t $CI_REGISTRY/sbibauw/languagelab:${COMPONENT}-dev $COMPONENT
- docker push $CI_REGISTRY/sbibauw/languagelab:${COMPONENT}-dev
docker_deploy-dev:
stage: deploy
only:
- dev
image: alpine:latest
script:
- echo "/mnt/data/languagelab/repo/scripts/update.dev.sh" > /mnt/pipeline