-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
55 lines (49 loc) · 1.01 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
# ######
# BUILD
# ######
.build: &build
image: docker:git
stage: build
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
build dev:
<<: *build
script:
- docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA-dev .
- docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA-dev
# ######
# TEST
# ######
.test: &test
image:
name: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA-dev
entrypoint: [""]
stage: test
environment:
name: test/$CI_COMMIT_REF_NAME
before_script:
- cd /app
.with_services: &with_services
variables:
MYSQL_ROOT_PASSWORD: mysql
variables:
DATABASE_URL: mysql://mysql:mysql@mariadb:3306/elph_test
MYSQL_ROOT_PASSWORD: mysql
MYSQL_USER: mysql
MYSQL_PASSWORD: mysql
MYSQL_DATABASE: elph_test
services:
- mariadb:10.4
spec:
<<: *test
<<: *with_services
before_script:
- cd /app
- mix ecto.setup
script: mix test --cover
lint:
<<: *test
script: mix credo
audit:
<<: *test
script: mix deps.audit