Files
vision/.gitlab-ci.yml
2022-04-13 21:32:19 +02:00

79 lines
1.7 KiB
YAML

image: jakzal/phpqa
include:
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
before_script:
- composer install --no-scripts
cache:
paths:
- vendor/
stages:
- SecurityChecker
- CodingStandards
- UnitTests
- publish
security-checker:
stage: SecurityChecker
except:
- main
- dev
script:
- local-php-security-checker --path=./composer.lock
allow_failure: false
phpcs:
stage: CodingStandards
except:
- main
- dev
script:
- phpcs --version && phpcs --standard=PSR12 --ignore=./src/Kernel.php ./src
allow_failure: false
phpstan:
stage: CodingStandards
except:
- main
- dev
script:
- phpstan --version && phpstan analyse ./src
allow_failure: false
twig-lint:
stage: CodingStandards
except:
- main
- dev
script:
- twig-lint --version && twig-lint lint ./templates
allow_failure: false
publish:
stage: publish
image: docker:dind
services:
- docker:dind
only:
- main
variables:
DOCKER_DRIVER: overlay2
registry_host: ''
registry_user: ''
registry_pass: ''
registry_img: ''
before_script:
- apk add jq
script:
- APP_VERSION=$(cat package.json | jq .version -r)
- docker login $registry_host -u $registry_user -p $registry_pass
- docker build -f ./Dockerfile -t $registry_host/$registry_img:$APP_VERSION .
- docker push $registry_host/$registry_img:$APP_VERSION
- docker logout $registry_host
- docker images
- docker login $docker_host -u $docker_user -p $docker_pass
- docker tag $registry_host/$registry_img:$APP_VERSION $docker_img
- docker push $docker_img