Merge develop into feature/770-add-emoji-tags
[akkoma] / .gitlab-ci.yml
1 image: elixir:1.8.1
2
3 variables:
4 POSTGRES_DB: pleroma_test
5 POSTGRES_USER: postgres
6 POSTGRES_PASSWORD: postgres
7 DB_HOST: postgres
8 MIX_ENV: test
9
10 cache:
11 key: ${CI_COMMIT_REF_SLUG}
12 paths:
13 - deps
14 - _build
15 stages:
16 - build
17 - test
18 - deploy
19
20 before_script:
21 - mix local.hex --force
22 - mix local.rebar --force
23
24 build:
25 stage: build
26 script:
27 - mix deps.get
28 - mix compile --force
29
30 docs-build:
31 stage: build
32 only:
33 - master@pleroma/pleroma
34 - develop@pleroma/pleroma
35 variables:
36 MIX_ENV: dev
37 script:
38 - mix deps.get
39 - mix compile
40 - mix docs
41 artifacts:
42 paths:
43 - priv/static/doc
44
45 unit-testing:
46 stage: test
47 services:
48 - name: postgres:9.6.2
49 command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
50 script:
51 - mix ecto.create
52 - mix ecto.migrate
53 - mix test --trace --preload-modules
54
55 lint:
56 stage: test
57 script:
58 - mix format --check-formatted
59
60 analysis:
61 stage: test
62 script:
63 - mix deps.get
64 - mix credo --strict --only=warnings,todo,fixme,consistency,readability
65
66
67 docs-deploy:
68 stage: deploy
69 image: alpine:3.9
70 only:
71 - master@pleroma/pleroma
72 - develop@pleroma/pleroma
73 before_script:
74 - apk update && apk add openssh-client rsync
75 script:
76 - mkdir -p ~/.ssh
77 - echo "${SSH_HOST_KEY}" > ~/.ssh/known_hosts
78 - eval $(ssh-agent -s)
79 - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
80 - rsync -hrvz --delete -e "ssh -p ${SSH_PORT}" priv/static/doc/ "${SSH_USER_HOST_LOCATION}/${CI_COMMIT_REF_NAME}"