76 lines
1.8 KiB
YAML
76 lines
1.8 KiB
YAML
image: jakzal/phpqa
|
|
|
|
include:
|
|
- template: 'Workflows/MergeRequest-Pipelines.gitlab-ci.yml'
|
|
|
|
before_script:
|
|
- composer install --no-scripts
|
|
|
|
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 visionversion.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 login -u $docker_user -p $docker_pass
|
|
- docker tag $registry_host/$registry_img:$APP_VERSION $docker_host/$docker_img:$APP_VERSION
|
|
- docker tag $registry_host/$registry_img:$APP_VERSION $docker_host/$docker_img
|
|
- docker push $docker_host/$docker_img:$APP_VERSION
|
|
- docker push $docker_host/$docker_img |