Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 10.x
  • 11.x
  • 167
  • 305-tools-migrate-to-webpack
  • 7.x
  • 8.x
  • 9.x
  • artifacts
  • ci-contrib
  • ci-contrib-smile
  • ci-tests
  • ci-tests-example
  • setup-entity-share
  • test_tools
14 results

Target

Select target project
  • florenttorregrosa-drupal/docker-drupal-project
  • ines.wallon/docker-drupal-project
  • narenbabin/docker-drupal-project
  • amstal93/docker-drupal-project
  • checkscale-gitlab/docker-drupal-project
  • codr-drupal/docker-drupal-project
  • estoclet1/ddev-drupal-project
  • sereg-smile/docker-drupal-project
8 results
Select Git revision
  • 10.x
  • 11.x
  • 167
  • 305-tools-migrate-to-webpack
  • 7.x
  • 8.x
  • 9.x
  • artifacts
  • ci-contrib
  • ci-contrib-smile
  • ci-tests
  • ci-tests-example
  • setup-entity-share
  • test_tools
14 results
Show changes
Commits on Source (5)
Showing with 127 additions and 71 deletions
......@@ -300,8 +300,10 @@ variables:
- cd ./app && ./core/node_modules/.bin/eslint
--config ./core/.eslintrc.legacy.json
--no-error-on-unmatched-pattern
--ignore-pattern "*.es6.js"
"./**/custom/**/*.js"
--ignore-path ../scripts/quality/eslint/.eslintignore
"./modules/custom/**/*.js"
"./profiles/custom/**/*.js"
"./themes/custom/**/*.js"
'JS Lint ES6':
extends: .code_quality_default
......@@ -309,7 +311,10 @@ variables:
- cd ./app && ./core/node_modules/.bin/eslint
--config ./core/.eslintrc.json
--no-error-on-unmatched-pattern
"./**/custom/**/*.es6.js"
--ignore-path ../scripts/quality/eslint_es6/.eslintignore
"./modules/custom/**/*.es6.js"
"./profiles/custom/**/*.es6.js"
"./themes/custom/**/*.es6.js"
'Spellcheck':
extends: .code_quality_default
......
......@@ -321,8 +321,10 @@ quality-js: ## Launch ESLint for non-compiled JS.
${APP_PATH}/core/node_modules/.bin/eslint \
--config ${APP_PATH}/core/.eslintrc.legacy.json \
--no-error-on-unmatched-pattern \
--ignore-pattern "*.es6.js" \
"${APP_PATH}/**/custom/**/*.js"'
--ignore-path "$(PROJECT_PATH)/scripts/quality/eslint/.eslintignore" \
"${APP_PATH}/modules/custom/**/*.js" \
"${APP_PATH}/profiles/custom/**/*.js" \
"${APP_PATH}/themes/custom/**/*.js"'
.PHONY: quality-js-es6
quality-js-es6: ## Launch ESLint for ES6 JS.
......@@ -332,7 +334,10 @@ quality-js-es6: ## Launch ESLint for ES6 JS.
${APP_PATH}/core/node_modules/.bin/eslint \
--config ${APP_PATH}/core/.eslintrc.json \
--no-error-on-unmatched-pattern \
"${APP_PATH}/**/custom/**/*.es6.js"'
--ignore-path "$(PROJECT_PATH)/scripts/quality/eslint_es6/.eslintignore" \
"${APP_PATH}/modules/custom/**/*.es6.js" \
"${APP_PATH}/profiles/custom/**/*.es6.js" \
"${APP_PATH}/themes/custom/**/*.es6.js"'
.PHONY: quality-rector
quality-rector: ## Launch Rector.
......@@ -485,8 +490,10 @@ quality-fix-js: ## Launch ESLint for non-compiled JS.
--config ${APP_PATH}/core/.eslintrc.legacy.json \
--fix \
--no-error-on-unmatched-pattern \
--ignore-pattern "*.es6.js" \
"${APP_PATH}/**/custom/**/*.js"'
--ignore-path "$(PROJECT_PATH)/scripts/quality/eslint/.eslintignore" \
"${APP_PATH}/modules/custom/**/*.js" \
"${APP_PATH}/profiles/custom/**/*.js" \
"${APP_PATH}/themes/custom/**/*.js"'
.PHONY: quality-fix-js-es6
quality-fix-js-es6: ## Launch ESLint for ES6 JS.
......@@ -497,7 +504,10 @@ quality-fix-js-es6: ## Launch ESLint for ES6 JS.
--config ${APP_PATH}/core/.eslintrc.json \
--fix \
--no-error-on-unmatched-pattern \
"${APP_PATH}/**/custom/**/*.es6.js"'
--ignore-path "$(PROJECT_PATH)/scripts/quality/eslint_es6/.eslintignore" \
"${APP_PATH}/modules/custom/**/*.es6.js" \
"${APP_PATH}/profiles/custom/**/*.es6.js" \
"${APP_PATH}/themes/custom/**/*.es6.js"'
.PHONY: quality-fix-all
quality-fix-all: ## Launch all code quality fix of the project.
......
<?php
declare(strict_types = 1);
// phpcs:ignoreFile
// See https://git.drupalcode.org/project/drupal/blob/HEAD/sites/default/default.settings.php
......
<?php
declare(strict_types = 1);
// phpcs:ignoreFile
$sites[$_ENV['DRUPAL_SITE_DEFAULT_DOMAIN_1']] = $_ENV['DRUPAL_SITE_DEFAULT_FOLDER_NAME'];
......
......@@ -4,7 +4,7 @@ When making a minor/major core update, there are some manual steps to do:
* files to check for, if there has been changes in Drupal core:
| Project's path | Standard's path |
|-----------------------------------------------|---|
|------------------------------------------------|----------------------------------------------|
| conf/drupal/default/development.services.yml | app/sites/development.services.yml |
| conf/drupal/default/example.settings.local.php | app/sites/default/default.settings.php |
| conf/drupal/default/example.settings.local.php | app/sites/example.settings.local.php |
......
<?php
declare(strict_types = 1);
namespace Drush\Commands;
use Consolidation\AnnotatedCommand\CommandData;
......@@ -10,16 +12,18 @@
class PolicyCommands extends DrushCommands {
/**
* Prevent catastrophic braino. Note that this file has to be local to the
* machine that initiates the sql:sync command.
* Prevent catastrophic braino.
*
* Note that this file has to be local to the machine that initiates the
* sql:sync command.
*
* @hook validate sql:sync
*
* @throws \Exception
*/
public function sqlSyncValidate(CommandData $commandData) {
public function sqlSyncValidate(CommandData $commandData): void {
if ($commandData->input()->getArgument('target') == '@prod') {
throw new \Exception(dt('Per !file, you may never overwrite the production database.', ['!file' => __FILE__]));
throw new \Exception(\dt('Per !file, you may never overwrite the production database.', ['!file' => __FILE__]));
}
}
......@@ -30,9 +34,10 @@ public function sqlSyncValidate(CommandData $commandData) {
*
* @throws \Exception
*/
public function rsyncValidate(CommandData $commandData) {
if (preg_match("/^@prod/", $commandData->input()->getArgument('target'))) {
throw new \Exception(dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__]));
public function rsyncValidate(CommandData $commandData): void {
if (\preg_match('/^@prod/', $commandData->input()->getArgument('target'))) {
throw new \Exception(\dt('Per !file, you may never rsync to the production site.', ['!file' => __FILE__]));
}
}
}
......@@ -13,11 +13,12 @@ XDEBUG_ENABLED=false
BEHAT_PROFILE=gitlab-ci
### PATHS.
PROJECT_PATH=/builds/florenttorregrosa-drupal/docker-drupal-project
APP_PATH=/builds/florenttorregrosa-drupal/docker-drupal-project/app
SCRIPTS_PATH=/builds/florenttorregrosa-drupal/docker-drupal-project/scripts
WWW_PATH=/builds/florenttorregrosa-drupal/docker-drupal-project/www
DRUSH=/builds/florenttorregrosa-drupal/docker-drupal-project/vendor/bin/drush
# Real paths are detected automatically in scripts/script-parameters.sh
PROJECT_PATH=/project
APP_PATH=/project/app
SCRIPTS_PATH=/project/scripts
WWW_PATH=/project/www
DRUSH=/project/vendor/bin/drush
### Services versions.
DOCKER_SERVICE_WEB_IMAGE=florenttorregrosa/drupal-php-dev:8.1-apache
......
......@@ -9,7 +9,7 @@ const mode = require('gulp-mode')({
verbose: false
});
const rename = require('gulp-rename');
const sass = require('gulp-sass');
const sass = require('gulp-sass')(require('sass'));
const sassGlob = require('gulp-sass-glob');
const sourcemaps = require('gulp-sourcemaps');
const uglify = require('gulp-uglify');
......@@ -37,7 +37,7 @@ const imageMinSvgoOptions = {
]
};
const sassOptions = {
outputStyle: (mode.production() ? 'compressed' : 'compact')
outputStyle: (mode.production() ? 'compressed' : 'expanded')
};
const uglifyOptions = {
compress: {
......
......@@ -14,12 +14,13 @@
"gulp-imagemin": "7.*",
"gulp-mode": "1.*",
"gulp-rename": "2.*",
"gulp-sass": "4.*",
"gulp-sass": "5.*",
"gulp-sass-glob": "1.*",
"gulp-sourcemaps": "3.*",
"gulp-uglify": "3.*",
"gulp.spritesmith": "6.*",
"merge-stream": "2.*"
"merge-stream": "2.*",
"sass": "1.*"
},
"scripts": {
"gulp-dev": "gulp",
......
<?php
declare(strict_types = 1);
/**
* @file
* Contains \DrupalProject\composer\ScriptHandler.
......@@ -14,12 +16,18 @@
use Symfony\Component\Filesystem\Filesystem;
use Webmozart\PathUtil\Path;
/**
* Composer scripts.
*/
class ScriptHandler {
public static function createRequiredFiles(Event $event) {
/**
* Creates required files for Drupal and tests to work.
*/
public static function createRequiredFiles(Event $event): void {
$fs = new Filesystem();
$drupalFinder = new DrupalFinder();
$drupalFinder->locateRoot(getcwd());
$drupalFinder->locateRoot(\getcwd());
$drupalRoot = $drupalFinder->getDrupalRoot();
$dirs = [
......@@ -28,7 +36,7 @@ public static function createRequiredFiles(Event $event) {
'themes',
];
// Required for unit testing
// Required for unit testing.
foreach ($dirs as $dir) {
if (!$fs->exists($drupalRoot . '/' . $dir)) {
$fs->mkdir($drupalRoot . '/' . $dir);
......@@ -36,7 +44,7 @@ public static function createRequiredFiles(Event $event) {
}
}
// Prepare the settings file for installation
// Prepare the settings file for installation.
if (!$fs->exists($drupalRoot . '/sites/default/settings.php') && $fs->exists($drupalRoot . '/sites/default/default.settings.php')) {
$fs->copy($drupalRoot . '/sites/default/default.settings.php', $drupalRoot . '/sites/default/settings.php');
require_once $drupalRoot . '/core/includes/bootstrap.inc';
......@@ -46,17 +54,17 @@ public static function createRequiredFiles(Event $event) {
'value' => Path::makeRelative($drupalFinder->getComposerRoot() . '/config/sync', $drupalRoot),
'required' => TRUE,
];
drupal_rewrite_settings($settings, $drupalRoot . '/sites/default/settings.php');
\drupal_rewrite_settings($settings, $drupalRoot . '/sites/default/settings.php');
$fs->chmod($drupalRoot . '/sites/default/settings.php', 0666);
$event->getIO()->write("Created a sites/default/settings.php file with chmod 0666");
$event->getIO()->write('Created a sites/default/settings.php file with chmod 0666');
}
// Create the files directory with chmod 0777
// Create the files directory with chmod 0777.
if (!$fs->exists($drupalRoot . '/sites/default/files')) {
$oldmask = umask(0);
$oldmask = \umask(0);
$fs->mkdir($drupalRoot . '/sites/default/files', 0777);
umask($oldmask);
$event->getIO()->write("Created a sites/default/files directory with chmod 0777");
\umask($oldmask);
$event->getIO()->write('Created a sites/default/files directory with chmod 0777');
}
}
......@@ -74,7 +82,7 @@ public static function createRequiredFiles(Event $event) {
*
* @see https://github.com/composer/composer/pull/5035
*/
public static function checkComposerVersion(Event $event) {
public static function checkComposerVersion(Event $event): void {
$composer = $event->getComposer();
$io = $event->getIO();
......@@ -82,7 +90,7 @@ public static function checkComposerVersion(Event $event) {
// The dev-channel of composer uses the git revision as version number,
// try to the branch alias instead.
if (preg_match('/^[0-9a-f]{40}$/i', $version)) {
if (\preg_match('/^[0-9a-f]{40}$/i', $version)) {
$version = $composer::BRANCH_ALIAS_VERSION;
}
......
assets/vendor/**/*
node_modules/**/*
*.es6.js
assets/vendor/**/*
node_modules/**/*
......@@ -8,6 +8,20 @@
. "$(dirname "${BASH_SOURCE[0]}")"/selection-environment.sh "$1"
fi
# Paths.
if [ -n "${CI_PROJECT_DIR}" ]; then
# If CI_PROJECT_DIR is defined it means we are in Gitlab CI.
PROJECT_PATH=${CI_PROJECT_DIR}
# shellcheck disable=SC2034
APP_PATH=${PROJECT_PATH}/app
# shellcheck disable=SC2034
SCRIPTS_PATH=${PROJECT_PATH}/scripts
# shellcheck disable=SC2034
WWW_PATH=${PROJECT_PATH}/www
# shellcheck disable=SC2034
DRUSH=${PROJECT_PATH}/vendor/bin/drush
fi
# Test if jq exists so script-parameters.sh can be included when launched from
# host machine.
if command -v jq &> /dev/null; then
......
<?php
declare(strict_types = 1);
use Behat\Behat\Context\Context;
/**
......@@ -14,6 +16,7 @@ class FeatureContext implements Context {
* You can also pass arbitrary arguments to the
* context constructor through behat.yml.
*/
public function __construct() {}
public function __construct() {
}
}
......@@ -4,7 +4,7 @@
. "$(dirname "$(dirname "$(dirname "${BASH_SOURCE[0]}")")")"/script-parameters.sh local
# Detect if executed in Gitlab CI or not.
EXPORT=''
EXPORT='--testdox'
if [ -n "${CI_PROJECT_DIR}" ]; then
# Temporary directory as the phpunit command is executed as the webserver
# user.
......