aboutsummaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: a433c182168e22b67d2d3d49890cac3f18024ee6 (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
image: studip/studip:tests-php8.1

variables:
  FF_NETWORK_PER_BUILD: 1
  GIT_DEPTH: 1
  MYSQL_RANDOM_ROOT_PASSWORD: "true"
  MYSQL_DATABASE: studip_db
  MYSQL_USER: studip_user
  MYSQL_PASSWORD: studip_password
  MYSQL_HOST: mariadb
  DEMO_DATA: "true"
  MAIL_TRANSPORT: debug
  PHPSTAN_LEVEL: 0
  # Optimize caching
  FF_USE_FASTZIP: "true"
  CACHE_COMPRESSION_LEVEL: "fast"
  # Use faster docker driver
  DOCKER_DRIVER: overlay2
  # Images
  NODE_IMAGE: node:18-slim
  # Directories
  CACHE_DIR: .caches
  REPORT_DIR: .reports
  # Set npm cache directory
  npm_config_cache: $CI_PROJECT_DIR/.npm

stages:
  - docs

.scripts:
  mkdir-caches: &mkdir-caches
    - mkdir -p $CACHE_DIR
  mkdir-reports: &mkdir-reports
    - mkdir -p $REPORT_DIR
  install-composer: &install-composer
    - make composer-dev
  configure-studip: &configure-studip
    - *install-composer
    - cp docker/studip/config_local.php config/config_local.inc.php
    - cp config/config.inc.php.dist config/config.inc.php
  initialize-studip-database: &initialize-studip-database
    - *configure-studip
    - chmod +x .gitlab/scripts/install_db.sh
    - .gitlab/scripts/install_db.sh
    - cli/studip migrate

.caches:
  composer: &composer-cache
    key:
      files:
        - composer.lock
    paths:
      - composer/
    policy: pull
  npm: &npm-cache
    key:
      files:
        - package-lock.json
    paths:
      - .npm

.definitions:
  mariadb-service: &mariadb-service
   - name: mariadb
     command: [ "--sql_mode=","--character-set-client=utf8","--character-set-server=utf8","--collation-server=utf8_unicode_ci"]

docs:
  stage: docs
  interruptible: true
  image: node:22-alpine
  script:
  - apk update && apk --no-cache add git
  - cd docs
  - yarn install
  - yarn build
  - rm -rf ../public
  - mv ./build ../public
  artifacts:
    paths:
    - public