Commit f7a141b2 authored by Ines WALLON's avatar Ines WALLON
Browse files

add contrib modules

parent ad72f041
Pipeline #645 failed with stages
in 18 minutes and 59 seconds
.code_quality_default:
stage: Code quality
image: libert/drupal-php-dev:7.4
needs: ['Build Drupal']
.phpunit_default:
stage: Test
needs: ['Build Drupal']
image: docker/compose:latest
before_script:
- docker login -u $HUB_USERNAME -p $HUB_PASSWORD
- sed -i "s/FIXUID=1000/FIXUID=0/g" .env
- sed -i "s/FIXGID=1000/FIXGID=0/g" .env
- sed -i '/COMPOSER_AUTH/d' .env
- echo CMIS_URL_NUXEO=$CMIS_URL_NUXEO >> .env
- echo CMIS_URL_ALFRESCO=$CMIS_URL_ALFRESCO >> .env
- docker network create drupalci_nw
- docker-compose up -d
- sleep 30
- $WEB_CONTAINTER bash /project/scripts/install.sh "skeletond9" "d9@example.com"
stages:
- test
- init
- Code quality
- Test
services:
- docker:dind
......@@ -7,79 +31,121 @@ services:
variables:
DOCKER_DRIVER: overlay
WEB_CONTAINTER: "docker-compose exec -T web"
FIXUID: 0
FIXGID: 0
CMIS_URL_NUXEO: "http://nuxeo:8080/nuxeo/json/cmis"
CMIS_URL_ALFRESCO: "http://proxy:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser"
init_project:
stage: test
image: docker/compose:latest
'Build Drupal':
stage: init
image: libert/drupal-php-dev:7.4
tags:
- spud
script:
- mkdir /usr/local/composer || true
- echo $COMPOSER_AUTH > /usr/local/composer/auth.json
- cp config/.init_files/exemple.docker-compose.yml docker-compose.yml
- cp config/.init_files/exemple.env .env
- sed -i "s/FIXUID=1000/FIXUID=$(id -u)/g" .env
- sed -i "s/FIXGID=1000/FIXGID=$(id -g)/g" .env
- sed -i '/COMPOSER_AUTH/d' .env
- mkdir -p web/sites/default/
- cp config/drupal/example.settings.local.php config/drupal/settings.local.php
- cp config/drupal/example.settings.php web/sites/default/settings.php
- docker network create drupalci_nw
- docker-compose up -d
- sleep 30
- $WEB_CONTAINTER bash /project/scripts/install.sh "skeletond9" "d9@example.com"
- composer install --dev
artifacts:
paths:
- config/
- vendor/
- web/
- .env
- docker-compose.yml
rules:
- if: $CI_COMMIT_BRANCH == "develop" || $CI_COMMIT_BRANCH == "contrib_modules"
phpcs:
stage: test
image: docker/compose:latest
PHPCS:
extends: .code_quality_default
tags:
- spud
script:
- $WEB_CONTAINTER bash ./scripts/test-coding-standard.sh
- phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md web/modules/contrib_project/ --report-junit=./phpcs.xml
artifacts:
when: always
reports:
junit: phpcs.xml
rules:
- if: $CI_COMMIT_BRANCH == "contrib_modules"
phpstan:
stage: test
image: docker/compose:latest
PHPMD:
extends: .code_quality_default
tags:
- spud
script:
- $WEB_CONTAINTER ./vendor/bin/drupal-check web/modules/custom/
- phpmd web/modules/contrib_project/ ansi scripts/quality/phpmd.xml
rules:
- if: $CI_COMMIT_BRANCH == "contrib_modules"
allow_failure: true
phpunit_cmis:
stage: test
image: docker/compose:latest
PHPCPD:
extends: .code_quality_default
tags:
- spud
script:
- docker-compose -f ./web/modules/custom/cmis/tests/docker-compose.yml -d
- export CMIS_URL_NUXEO="http://nuxeo:8080/nuxeo/json/cmis"
- export CMIS_URL_ALFRESCO="http://proxy:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser"
- $WEB_CONTAINTER phpunit --testsuite=cmis
- phpcpd web/modules/contrib_project/ --log-pmd phpcpd.xml
artifacts:
when: always
reports:
junit: phpcpd.xml
rules:
- if: $CI_COMMIT_BRANCH == "contrib_modules"
phpunit_theme_permission:
stage: test
image: docker/compose:latest
PHPStan:
extends: .code_quality_default
tags:
- spud
script:
- $WEB_CONTAINTER phpunit --testsuite=theme_permission
- ./vendor/bin/drupal-check --memory-limit 512M --format=junit -d web/modules/contrib_project/ > phpstan.xml
artifacts:
when: always
reports:
junit: phpstan.xml
rules:
- if: $CI_COMMIT_BRANCH == "contrib_modules"
phpunit_paragraphs_usage:
stage: test
image: docker/compose:latest
'PHPUnit : CMIS':
extends: .phpunit_default
tags:
- spud
script:
- docker-compose -f web/modules/contrib_project/cmis/tests/docker-compose.yml up -d
- $WEB_CONTAINTER timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' $CMIS_URL_ALFRESCO)" != "401" ]]; do sleep 5; done'
- $WEB_CONTAINTER phpunit -v --log-junit ./phpunit_cmis.xml --testsuite=cmis
artifacts:
when: always
reports:
junit: phpunit_cmis.xml
rules:
- if: $CI_COMMIT_BRANCH == "contrib_modules"
'PHPUnit : Theme permission':
extends: .phpunit_default
tags:
- spud
script:
- $WEB_CONTAINTER phpunit --testsuite=paragraphs_usage
- $WEB_CONTAINTER phpunit -v --log-junit ./phpunit_theme_permission.xml --testsuite=theme_permission
artifacts:
when: always
reports:
junit: phpunit_theme_permission.xml
rules:
- if: $CI_COMMIT_BRANCH == "contrib_modules"
'PHPUnit : paragraphs Usage':
extends: .phpunit_default
tags:
- spud
script:
- $WEB_CONTAINTER phpunit -v --log-junit ./phpunit_paragraphs_usage.xml --testsuite=paragraphs_usage
artifacts:
when: always
reports:
junit: phpunit_paragraphs_usage.xml
rules:
- if: $CI_COMMIT_BRANCH == "contrib_modules"
......@@ -36,6 +36,7 @@
"require-dev": {
"drupal/core-dev": "^9",
"mglaman/drupal-check": "^1.1",
"phpspec/prophecy-phpunit": "^2.0",
"roave/security-advisories": "dev-master"
},
"conflict": {
......@@ -86,7 +87,6 @@
"[web-root]/README.txt": false,
"[web-root]/sites/development.services.yml": false,
"[web-root]/sites/example.settings.local.php": false,
"[web-root]/sites/default/default.services.yml": false,
"[web-root]/sites/default/development.settings.php": false
}
},
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "1de291567f15ac056086391482954c31",
"content-hash": "7bb780e401729fca31a4783a0ddc1319",
"packages": [
{
"name": "asm89/stack-cors",
......@@ -9602,25 +9602,24 @@
},
{
"name": "mglaman/drupal-check",
"version": "1.1.6",
"version": "1.1.7",
"source": {
"type": "git",
"url": "https://github.com/mglaman/drupal-check.git",
"reference": "a539f52631ed3099b84ff70f620932d428aa49a5"
"reference": "af5d3cba507128bb2f730862e324eb9127085090"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/mglaman/drupal-check/zipball/a539f52631ed3099b84ff70f620932d428aa49a5",
"reference": "a539f52631ed3099b84ff70f620932d428aa49a5",
"url": "https://api.github.com/repos/mglaman/drupal-check/zipball/af5d3cba507128bb2f730862e324eb9127085090",
"reference": "af5d3cba507128bb2f730862e324eb9127085090",
"shasum": ""
},
"require": {
"composer/xdebug-handler": "^1.3",
"jean85/pretty-package-versions": "~1.5.0",
"mglaman/phpstan-drupal": "^0.12.4",
"mglaman/phpstan-drupal": "^0.12.8",
"nette/neon": "^3.1",
"php": "~7.2",
"phpstan/phpstan": "^0.12.26",
"phpstan/phpstan-deprecation-rules": "^0.12",
"symfony/console": "~3.2 || ~4.0",
"symfony/process": "~3.2 || ~4.0",
......@@ -9651,7 +9650,7 @@
"description": "CLI tool for running checks on a Drupal code base",
"support": {
"issues": "https://github.com/mglaman/drupal-check/issues",
"source": "https://github.com/mglaman/drupal-check/tree/1.1.6"
"source": "https://github.com/mglaman/drupal-check/tree/1.1.7"
},
"funding": [
{
......@@ -9667,7 +9666,7 @@
"type": "tidelift"
}
],
"time": "2020-12-21T17:42:36+00:00"
"time": "2021-02-06T02:13:19+00:00"
},
{
"name": "mglaman/phpstan-drupal",
......@@ -10429,6 +10428,58 @@
},
"time": "2020-12-19T10:15:11+00:00"
},
{
"name": "phpspec/prophecy-phpunit",
"version": "v2.0.1",
"source": {
"type": "git",
"url": "https://github.com/phpspec/prophecy-phpunit.git",
"reference": "2d7a9df55f257d2cba9b1d0c0963a54960657177"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpspec/prophecy-phpunit/zipball/2d7a9df55f257d2cba9b1d0c0963a54960657177",
"reference": "2d7a9df55f257d2cba9b1d0c0963a54960657177",
"shasum": ""
},
"require": {
"php": "^7.3 || ^8",
"phpspec/prophecy": "^1.3",
"phpunit/phpunit": "^9.1"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
}
},
"autoload": {
"psr-4": {
"Prophecy\\PhpUnit\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Christophe Coevoet",
"email": "stof@notk.org"
}
],
"description": "Integrating the Prophecy mocking library in PHPUnit test cases",
"homepage": "http://phpspec.net",
"keywords": [
"phpunit",
"prophecy"
],
"support": {
"issues": "https://github.com/phpspec/prophecy-phpunit/issues",
"source": "https://github.com/phpspec/prophecy-phpunit/tree/v2.0.1"
},
"time": "2020-07-09T08:33:42+00:00"
},
{
"name": "phpstan/phpstan",
"version": "0.12.71",
......
This diff is collapsed.
......@@ -6,13 +6,13 @@
},
"extra": {
"installer-paths": {
"web/modules/custom/cmis": [
"web/modules/contrib_project/cmis": [
"drupal/cmis"
],
"web/modules/custom/paragraphs_usage": [
"web/modules/contrib_project/paragraphs_usage": [
"drupal/paragraphs_usage"
],
"web/modules/custom/theme_permission": [
"web/modules/contrib_project/theme_permission": [
"drupal/theme_permission"
]
}
......
......@@ -3,7 +3,7 @@ version: "3.3"
services:
web:
image: libert/drupal-php-dev:7.3
image: libert/drupal-php-dev:7.4
env_file:
- ".env"
user: ${FIXUID:-1000}:${FIXGID:-1000}
......
......@@ -10,6 +10,7 @@ $settings['file_scan_ignore_directories'] = [
];
$settings['container_yamls'][] = $app_root . '/' . $site_path . '/services.yml';
$settings['install_profile'] = 'minimal';
$settings['file_chmod_directory'] = 2775;
// Prevent deletion of orphan files.
// TODO: Remove this line when the following issues will be fixed:
// - https://www.drupal.org/node/2801777
......
......@@ -34,7 +34,7 @@
<directory>./web/modules/contrib_project/cmis/tests/</directory>
</testsuite>
<testsuite name="paragraphs_usage">
<directory>./web/modules/custom/paragraphs_usage/tests/</directory>
<directory>./web/modules/contrib_project/paragraphs_usage/tests/</directory>
</testsuite>
</testsuites>
<!-- Filter for coverage reports. -->
......
......@@ -10,11 +10,11 @@ else
composer install --working-dir=$WORK_DIR --no-dev
fi
find $WORK_DIR/web/sites/default/files/ -type d -exec chmod 775 '{}' \;
mkdir -p $WORK_DIR/web/sites/default/files/
find $WORK_DIR/web/sites/default/files/ -type d -exec chmod 777 '{}' \;
find $WORK_DIR/web/sites/default/files/ -type f -exec chmod 644 '{}' \;
chown www-data:www-data $WORK_DIR/web/sites/default/files/ -R
sleep 30
# Site install
......
<?xml version="1.0"?>
<ruleset name="Drupal PHPMD Ruleset"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation=" http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>
Ruleset for PHPMD analysis of Drupal projects. Excludes coding issues
handled better by PHPCS and rules which have too many false positives
in a typical Drupal codebase.
</description>
<rule ref="rulesets/codesize.xml">
<exclude name="ExcessiveMethodLength" />
</rule>
<rule ref="rulesets/controversial.xml/Superglobals" />
<rule ref="rulesets/design.xml" />
<rule ref="rulesets/naming.xml" />
<rule ref="rulesets/unusedcode.xml">
<exclude name="UnusedFormalParameter" />
</rule>
</ruleset>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment