forked from cnorthwood/virtualbarcamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
76 lines (72 loc) · 1.68 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
stages:
- prepare
- test
- build
Build Testing Image:
stage: prepare
image: docker:latest
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker pull $CI_REGISTRY_IMAGE/dev-base:latest || true
- docker build --cache-from $CI_REGISTRY_IMAGE/dev-base:latest --tag $CI_REGISTRY_IMAGE/dev-base:latest --target dev-base .
- docker push $CI_REGISTRY_IMAGE/dev-base:latest
Browser Tests:
stage: test
image:
name: node:14
before_script:
- yarn
script:
- yarn test
- yarn audit --groups dependencies
cache:
paths:
- node_modules/
key: browser-tests
App Tests:
stage: test
image:
name: $CI_REGISTRY_IMAGE/dev-base:latest
services:
- postgres:12
- redis:6
variables:
DEBUG: "True"
POSTGRES_DB: virtualbarcamp
POSTGRES_USER: virtualbarcamp
POSTGRES_PASSWORD: virtualbarcamp
DB_HOST: postgres
DB_USER: virtualbarcamp
DB_PASSWORD: virtualbarcamp
DB_NAME: virtualbarcamp
REDIS_URI: redis://redis
DISCORD_SYNC_DISABLED: "True"
before_script:
- poetry config virtualenvs.in-project true
- poetry install
script:
- poetry run pytest virtualbarcamp
- poetry run black --check virtualbarcamp
cache:
paths:
- .venv
key: app-tests
Build image:
stage: build
image: docker:latest
services:
- docker:dind
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script:
- docker build
--pull --no-cache
-t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
.
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
variables:
DOCKER_BUILDKIT: "1"
only:
- main