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.

82 lines
1.6KB

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