.gitlab-ci.yml 1.54 KB
Newer Older
rinpatch's avatar
rinpatch committed
1
image: elixir:1.8.1
lain's avatar
lain committed
2
3
4
5


variables:
  POSTGRES_DB: pleroma_test
Roger Braun's avatar
Roger Braun committed
6
7
  POSTGRES_USER: postgres
  POSTGRES_PASSWORD: postgres
lain's avatar
lain committed
8
  DB_HOST: postgres
9
  MIX_ENV: test
10

rinpatch's avatar
rinpatch committed
11
cache:
12
  key: ${CI_COMMIT_REF_SLUG}
rinpatch's avatar
rinpatch committed
13
14
  paths:
          - deps
Rin Toshaka's avatar
Rin Toshaka committed
15
          - _build
lain's avatar
lain committed
16
stages:
17
  - build
lain's avatar
lain committed
18
  - test
19
  - deploy
lain's avatar
lain committed
20
21

before_script:
lain's avatar
lain committed
22
23
  - mix local.hex --force
  - mix local.rebar --force
lain's avatar
lain committed
24

25
26
build:
  stage: build
lain's avatar
lain committed
27
  script:
28
29
  - mix deps.get --only test
  - mix compile --force
rinpatch's avatar
rinpatch committed
30
31

docs_build:
32
  stage: build
rinpatch's avatar
rinpatch committed
33
34
35
36
37
  only:
  - master@pleroma/pleroma
  - develop@pleroma/pleroma
  variables:
    MIX_ENV: dev
38
  script:
rinpatch's avatar
rinpatch committed
39
40
41
42
43
44
45
    - mix deps.get
    - mix compile
    - mix docs
  artifacts:
    paths:
      - priv/static/doc

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
unit-testing:
  stage: test
  services:
  - name: postgres:9.6.2
    command: ["postgres", "-c", "fsync=off", "-c", "synchronous_commit=off", "-c", "full_page_writes=off"]
  script:
    - mix ecto.create
    - mix ecto.migrate
    - mix test --trace --preload-modules

lint:
  stage: test
  script:
    - mix format --check-formatted

analysis:
  stage: test
  script:
    - mix credo --strict --only=warnings,todo,fixme,consistency,readability


rinpatch's avatar
rinpatch committed
67
docs_deploy:
68
  stage: deploy
rinpatch's avatar
rinpatch committed
69
  image: alpine:3.9
70
  services:
rinpatch's avatar
rinpatch committed
71
72
73
74
75
76
77
78
79
80
81
  only:
  - master@pleroma/pleroma
  - develop@pleroma/pleroma
  before_script:
    - apk update && apk add openssh-client rsync
  script:
    - mkdir -p ~/.ssh
    - echo "${SSH_HOST_KEY}" > ~/.ssh/known_hosts
    - eval $(ssh-agent -s)
    - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
    - rsync -hrvz --delete -e "ssh -p ${SSH_PORT}" priv/static/doc/ "${SSH_USER_HOST_LOCATION}/${CI_COMMIT_REF_NAME}"