.gitlab-ci.yml 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. variables:
  2. PROJECT_NAME: glitchtip
  3. IMAGE_NAME: registry.gitlab.com/glitchtip/glitchtip-backend
  4. CONTAINER_TEST_IMAGE: registry.gitlab.com/glitchtip/glitchtip-backend:$CI_BUILD_REF_NAME
  5. PIP_DISABLE_PIP_VERSION_CHECK: "on"
  6. PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
  7. POETRY_VIRTUALENVS_CREATE: "false"
  8. POSTGRES_HOST_AUTH_METHOD: "trust"
  9. DEBUG: "true"
  10. include:
  11. - template: SAST.gitlab-ci.yml
  12. - template: Dependency-Scanning.gitlab-ci.yml
  13. - template: Secret-Detection.gitlab-ci.yml
  14. workflow:
  15. rules:
  16. - when: always
  17. test:
  18. image: python:3.10
  19. variables:
  20. SECRET_KEY: testing
  21. ENABLE_TEST_API: "true"
  22. ENABLE_OPEN_USER_REGISTRATION: "true"
  23. services:
  24. - postgres:14
  25. cache:
  26. key: ${CI_COMMIT_REF_SLUG}
  27. paths:
  28. - .cache/pip
  29. script:
  30. - pip install poetry
  31. - poetry install --no-interaction --no-ansi
  32. - ./manage.py test
  33. lint:
  34. image: python:3.10
  35. script:
  36. - pip install poetry
  37. - poetry install --no-interaction --no-ansi
  38. - isort --check glitchtip
  39. # - pylint --load-plugins=pylint_django --django-settings-module=glitchtip.settings --disable=R glitchtip
  40. build:
  41. image: docker:20
  42. rules:
  43. - if: '$CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_REF_PROTECTED == "true"'
  44. services:
  45. - docker:20-dind
  46. script:
  47. - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
  48. - docker build -t $CONTAINER_TEST_IMAGE --build-arg IS_CI="True" .
  49. - docker push $CONTAINER_TEST_IMAGE