.gitlab-ci.yml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. buildx:
  41. image: docker:20-git
  42. artifacts:
  43. paths:
  44. - buildx
  45. expire_in: 1 hour
  46. services:
  47. - docker:20-dind
  48. script:
  49. - export DOCKER_BUILDKIT=1
  50. - git clone https://github.com/docker/buildx.git ./docker-buildx
  51. - docker build --platform=local -o . ./docker-buildx
  52. build:
  53. image: docker:20
  54. needs:
  55. - buildx
  56. services:
  57. - docker:20-dind
  58. before_script:
  59. - mkdir -p ~/.docker/cli-plugins
  60. - mv buildx ~/.docker/cli-plugins/docker-buildx
  61. - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
  62. script:
  63. - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
  64. - docker buildx create --use
  65. - docker buildx build --platform linux/arm64/v8 -t $CONTAINER_TEST_IMAGE --build-arg IS_CI="True" .