.gitlab-ci.yml 1.83 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
variables:
    DOCKER_HOST: "tcp://docker-dind.gitlab:2375"
    POSTGRES_ENABLED: "false"
    CODE_QUALITY_DISABLED: "true"
    CONTAINER_SCANNING_DISABLED: "true"
    DAST_DISABLED: "true"
    DEPENDENCY_SCANNING_DISABLED: "true"
    LICENSE_MANAGEMENT_DISABLED: "true"
    PERFORMANCE_DISABLED: "true"
    SAST_DISABLED: "true"
    TEST_DISABLED: "true"

Dominik Hebeler's avatar
Dominik Hebeler committed
13 14 15
include:
  - template: Jobs/Build.gitlab-ci.yml

16 17
stages:
  - prepare
Dominik Hebeler's avatar
Dominik Hebeler committed
18
  - build
19

Dominik Hebeler's avatar
Dominik Hebeler committed
20 21 22
build:
  services:

23
# Prepares the secret files that we cannot or don't want to share with public
24 25 26 27 28 29 30
prepare_secrets:
  stage: prepare
  image: alpine:latest
  script: 
    - cp $ENVFILE .env
    - cp $SUMAS config/sumas.json
    - cp $SUMASEN config/sumasEn.json
Dominik Hebeler's avatar
Dominik Hebeler committed
31 32 33 34 35 36
    - cp $BLACKLISTURL config/blacklistUrl.txt
    - cp $BLACKLISTDOMAINS config/blacklistDomains.txt
    - cp $ADBLACKLISTURL config/adBlacklistUrl.txt
    - cp $ADBLACKLISTDOMAINS config/adBlacklistDomains.txt
    - cp $SPAM config/spam.txt
    - cp $USERSSEEDER database/seeds/UsersSeeder.php
37 38 39 40
  artifacts:
    paths:
      - .env
      - config/sumas.json
Dominik Hebeler's avatar
Dominik Hebeler committed
41 42 43 44 45 46 47 48 49
      - config/sumasEn.json
      - config/blacklistUrl.txt
      - config/blacklistDomains.txt
      - config/adBlacklistUrl.txt
      - config/adBlacklistDomains.txt
      - config/spam.txt
      - database/seeds/UsersSeeder.php
  only:
    - branches
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
    - tags

prepare_node:
  stage: prepare
  image: node:10
  before_script:
    - npm install
  script:
    - npm run prod
  artifacts:
    paths:
      - public/js/
      - public/css/
  cache:
    # Cache per Branch
    key: "node-$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG"
    paths:
      - node_modules
  only:
    - branches
    - tags

Dominik Hebeler's avatar
Dominik Hebeler committed
72 73 74 75 76 77 78 79 80 81 82 83
prepare_composer:
  stage: prepare
  image: prooph/composer:7.3
  script:
    - composer install
  artifacts:
    paths:
      - vendor
  cache:
    key: "composer-$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG"
    paths:
      - vendor