Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
1.6KB

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