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 - mkdir -p .docker - "docker load -q -i .docker/fs.tar 2>&1 || :" - rm -rf .docker 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 build --cache-from=$registry_host/$registry_img -t $registry_host/$registry_img . - 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 after_script: - mkdir -p .docker - "docker save -o .docker/fs.tar $docker_host/$docker_img 2>&1 || :" - docker system prune -a cache: - key: $CI_COMMIT_REF_SLUG paths: - .docker when: on_success