.gitlab-ci.yml 1.71 KB
Newer Older
dmorley's avatar
dmorley committed
1
stages:
dmorley's avatar
dmorley committed
2 3
  - test7.4
  - test8.0
dmorley's avatar
dmorley committed
4
  - deploy
5

dmorley's avatar
dmorley committed
6 7
test7.4:
  stage: test7.4
dmorley's avatar
dmorley committed
8 9 10 11
  cache:
    key: poduptime
    paths:
      - vendor/
dmorley's avatar
dmorley committed
12
  image: php:7.4-cli-alpine
dmorley's avatar
dmorley committed
13 14 15 16
  before_script:
    - apk add -U git
    - docker-php-ext-install -j$(nproc) bcmath
    - curl -sS https://getcomposer.org/installer | php
dmorley's avatar
dmorley committed
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
    - php composer.phar install
  script:
    - php composer.phar check-code

test8.0:
  stage: test8.0
  cache:
    key: poduptime
    paths:
      - vendor/
  image: php:8.0-cli-alpine
  before_script:
    - apk add -U git
    - docker-php-ext-install -j$(nproc) bcmath
    - curl -sS https://getcomposer.org/installer | php
dmorley's avatar
dmorley committed
32
    - php composer.phar install
dmorley's avatar
dmorley committed
33 34
  script:
    - php composer.phar check-code
dmorley's avatar
dmorley committed
35 36 37

deploy:
  stage: deploy
dmorley's avatar
dmorley committed
38 39
  environment:
    name: development
dmorley's avatar
dmorley committed
40
  before_script:
dmorley's avatar
dmorley committed
41
    - export DEBIAN_FRONTEND=noninteractive
dmorley's avatar
yarn ci  
dmorley committed
42 43 44 45
    - apt-get update && apt-get install -y sudo curl gnupg2
    - curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
    - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
    - apt-get update && apt-get install -y sudo curl gnupg2 npm nodejs minify zip unzip php7.4 php7.4-curl php7.4-pgsql php7.4-bcmath php-geoip php7.4-cli php7.4-common php7.4-fpm php7.4-bcmath php7.4-json php7.4-readline php7.4-mbstring php7.4-xml php7.4-intl php-cgi git yarn
dmorley's avatar
dmorley committed
46
    - rm .yarnrc.yml
dmorley's avatar
dmorley committed
47
    - yarn set version berry
dmorley's avatar
dmorley committed
48
    - "echo 'nodeLinker: 'node-modules'' | tee -a .yarnrc.yml"
dmorley's avatar
dmorley committed
49
  script:
dmorley's avatar
deploy  
dmorley committed
50 51
    - curl -sS https://getcomposer.org/installer | php
    - php composer.phar install
dmorley's avatar
yarn ci  
dmorley committed
52
    - yarn install
dmorley's avatar
dmorley committed
53 54
    - minify -o js/podup.min.js js/podup.js
    - minify -o css/poduptime.min.css css/poduptime.css
dmorley's avatar
deploy  
dmorley committed
55
    - sudo cp -a ./ /var/www/podupdev
dmorley's avatar
dmorley committed
56 57 58 59
  tags:
    - deploy
  only:
    - develop