summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: f7e3852a7ef67c3d4a874988c18fc9363328cd04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
stages:
  - lint
  - build
  - test
  - publish

variables:
  ESLINT_PATHS: js plugins
  REGISTRY_PROJECT: cthulhoo

include:
  - project: 'ci/ci-templates'
    ref: master
    file: .ci-build-docker-kaniko.yml
  - project: 'ci/ci-templates'
    ref: master
    file: .ci-lint-common.yml
  - project: 'ci/ci-templates'
    ref: master
    file: .ci-integration-test.yml

phpunit:
  extends: .phpunit
  variables:
    PHPUNIT_ARGS: --exclude integration

eslint:
  extends: .eslint

phpstan:
  extends: .phpstan

ttrss-web-nginx:branch:
  extends: .build-branch
  variables:
    DOCKERFILE: ${CI_PROJECT_DIR}/.docker/web-nginx/Dockerfile

ttrss-fpm-pgsql-static:branch:
  extends: .build-branch
  variables:
    DOCKERFILE: ${CI_PROJECT_DIR}/.docker/app/Dockerfile

ttrss-web-nginx:
  extends: .build-master-commit-only
  variables:
    DOCKERFILE: ${CI_PROJECT_DIR}/.docker/web-nginx/Dockerfile

ttrss-fpm-pgsql-static:
  extends: .build-master-commit-only
  variables:
    DOCKERFILE: ${CI_PROJECT_DIR}/.docker/app/Dockerfile

phpdoc:
  image: ${PHP_IMAGE}
  stage: publish
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $PHPDOC_DEPLOY_SSH_KEY != null
  script:
    - php82 /phpDocumentor.phar -d classes -d include -t phpdoc --visibility=public
    - mkdir -p ~/.ssh &&
        cp ${PHPDOC_DEPLOY_SSH_KEY} ~/.ssh/id_ed25519 &&
        chmod 0600 ~/.ssh/id_ed25519
    - rsync -av -e 'ssh -o StrictHostKeyChecking=no' phpdoc/ ${PHPDOC_DEPLOY_HOST}:phpdoc/

phpunit-integration:
  image: ${PHP_IMAGE}
  variables:
    TEST_HELM_REPO: https://gitlab.tt-rss.org/tt-rss/helm-charts/tt-rss
  extends: .integration-test
  script:
    - export K8S_NAMESPACE=$(kubectl get pods -o=custom-columns=NS:.metadata.namespace | tail -1)
    - export API_URL="http://tt-rss-${CI_COMMIT_SHORT_SHA}-app.$K8S_NAMESPACE.svc.cluster.local/tt-rss/api/"
    - php82 vendor/bin/phpunit --group integration

selenium:
  image: ${SELENIUM_IMAGE}
  variables:
    TEST_HELM_REPO: https://gitlab.tt-rss.org/tt-rss/helm-charts/tt-rss
    SELENIUM_GRID_ENDPOINT: http://selenium-hub.selenium-grid.svc.cluster.local:4444/wd/hub
  extends: .integration-test
  script:
    - export K8S_NAMESPACE=$(kubectl get pods -o=custom-columns=NS:.metadata.namespace | tail -1)
    - python3 tests/integration/selenium_test.py
  needs:
    - job: phpunit-integration

ttrss-web-nginx:publish:
  stage: publish
  extends: .build-master
  variables:
    DOCKERFILE: ${CI_PROJECT_DIR}/.docker/web-nginx/Dockerfile

ttrss-fpm-pgsql-static:publish:
  stage: publish
  extends: .build-master
  variables:
    DOCKERFILE: ${CI_PROJECT_DIR}/.docker/app/Dockerfile

update-demo:
  stage: publish
  image: ${HELM_IMAGE}
  variables:
    HELM_REPO: https://gitlab.tt-rss.org/tt-rss/helm-charts/tt-rss
  script:
    - git clone ${HELM_REPO} chart
    - helm upgrade --atomic --install tt-rss-demo chart --values .helm/values-demo.yaml --set imageTag=${CI_COMMIT_SHORT_SHA}
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_REGISTRY_USER != null && $UPDATE_DEMO == "true"