.gitlab-ci.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. test:
  15. image: python:3.10
  16. variables:
  17. SECRET_KEY: testing
  18. ENABLE_TEST_API: "true"
  19. ENABLE_OPEN_USER_REGISTRATION: "true"
  20. services:
  21. - postgres:13
  22. cache:
  23. key: ${CI_COMMIT_REF_SLUG}
  24. paths:
  25. - .cache/pip
  26. script:
  27. - pip install poetry
  28. - poetry install --no-interaction --no-ansi
  29. - ./manage.py test
  30. lint:
  31. image: python:3.10
  32. script:
  33. - pip install poetry
  34. - poetry install --no-interaction --no-ansi
  35. - isort --check glitchtip
  36. # - pylint --load-plugins=pylint_django --django-settings-module=glitchtip.settings --disable=R glitchtip
  37. build:
  38. image: docker:20
  39. rules:
  40. - if: '$CI_PIPELINE_SOURCE != "merge_request_event" && $CI_COMMIT_REF_PROTECTED == "true"'
  41. services:
  42. - docker:20-dind
  43. script:
  44. - docker build -t $CONTAINER_TEST_IMAGE --build-arg IS_CI="True" .
  45. - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
  46. - docker push $CONTAINER_TEST_IMAGE