Skip to content

Commit

Permalink
Merge pull request #12 from matthandus/feature/5-civicrm-domain-acces…
Browse files Browse the repository at this point in the history
…s-feature-request

Feature/5 civicrm domain access feature request
  • Loading branch information
matthandus authored Apr 20, 2022
2 parents 7ac6846 + e9d4057 commit f6b4b75
Show file tree
Hide file tree
Showing 6,094 changed files with 15,067 additions and 1,111,156 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
16 changes: 13 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ web/sites/example.settings.local.php
web/sites/example.sites.php
web/update.php
web/web.config
web/.gitignore
/web/INSTALL.txt
/web/README.txt
/web/example.gitignore
Expand Down Expand Up @@ -60,7 +61,14 @@ web/sites/simpletest
.idea

# Ignore files generated by VSCode
.vscode
.vscode/*
# Except Xdebug related files
!.vscode/launch.json
!.vscode/php.ini
# Except Code Sniffer
!.vscode/phpcs.sh
!.vscode/settings.json
!.vscode/twigcs.sh

# Local Lando Config
.lando.local.yml
Expand Down Expand Up @@ -100,5 +108,7 @@ drupal7
node_modules

# CiviCRM
# Commit compiled library temporarily.
# /web/libraries/civicrm
/web/libraries/civicrm

# Test Output
/private
93 changes: 84 additions & 9 deletions .lando.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,99 @@ name: matthandus-civicrm
recipe: drupal9
config:
webroot: web
xdebug: debug
config:
php: .vscode/php.ini
proxy:
appserver:
- matthandus-civicrm.lndo.site
- matthandus-civicrm-2.lndo.site
- matthandus-civicrm-3.lndo.site
mail:
- mail.matthandus-civicrm.lndo.site
services:
appserver:
build_as_root:
- pecl install uploadprogress
- docker-php-ext-enable uploadprogress
- curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
- apt-get install -y nodejs
- npm install --global yarn gulp@^4.0.2
build:
- composer install
node:
type: node
globals:
gulp: latest
- drush --root=/app/web sql-drop -y
- npm install -y
- yarn install --non-interactive --cwd /app/web/core
- drush --root=/app/web si --db-url=mysql://drupal9:drupal9@database/drupal9 -y
- cv core:install -f --cms-base-url="https://matthandus-civicrm.lndo.site/" --db=mysql://drupal9:drupal9@database/drupal9
- drush --root=/app/web theme:enable civics
- drush --root=/app/web config:set system.theme default civics -y
- gulp init
run:
- gulp watch
overrides:
environment:
DRUSH_OPTIONS_URI: "https://matthandus-civicrm.lndo.site"
SIMPLETEST_BASE_URL: "https://matthandus-civicrm.lndo.site/"
SIMPLETEST_DB: "sqlite://localhost/tmp/db.sqlite"
BROWSERTEST_OUTPUT_DIRECTORY: '/app/web/sites/simpletest/browser_output'
BROWSERTEST_OUTPUT_BASE_URL: 'https://matthandus-civicrm.lndo.site'
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--ignore-certificate-errors", "--disable-gpu", "--headless", "--no-sandbox"]}}, "http://chrome:9515"]'
# Nightwatch
DRUPAL_TEST_BASE_URL: "https://matthandus-civicrm.lndo.site/"
DRUPAL_TEST_DB_URL: 'mysql://drupal9:drupal9@database:3306/drupal9'
DRUPAL_TEST_WEBDRIVER_HOSTNAME: chrome
DRUPAL_TEST_WEBDRIVER_PORT: 9515
DRUPAL_TEST_CHROMEDRIVER_AUTOSTART: 'false'
DRUPAL_TEST_WEBDRIVER_CHROME_ARGS: "--ignore-certificate-errors --disable-gpu --headless --no-sandbox"
DRUPAL_NIGHTWATCH_OUTPUT: reports/nightwatch
DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES: node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest
chrome:
type: compose
app_mount: false
services:
image: drupalci/webdriver-chromedriver:production
command: chromedriver --log-path=/tmp/chromedriver.log --allowed-origins=* --verbose --whitelisted-ips=
mail:
type: mailhog
hogfrom:
- appserver
events:
pre-start:
- mkdir -p private/browsertest_output
- touch private/xdebug.log
tooling:
# Front-end tooling
npm:
service: node
service: appserver
node:
service: node
service: appserver
gulp:
service: node
service: appserver
yarn:
service: appserver
# Back-end tooling
drush:
service: appserver
env:
DRUSH_OPTIONS_URI: "https://matthandus-civicrm.lndo.site"
phpunit:
service: appserver
user: www-data
cmd:
- appserver: php /app/vendor/bin/phpunit -c /app/phpunit.xml
nightwatch:
service: appserver
description: Run Nightwatch.js
cmd:
- appserver: yarn test:nightwatch
dir: /app/web/core
# PHP Codesniffer
phpcs:
service: appserver
cmd: "/app/vendor/bin/phpcs --standard=Drupal,DrupalPractice"
phpcbf:
service: appserver
cmd: "/app/vendor/bin/phpcbf --standard=Drupal,DrupalPractice"
# Twig Codesniffer
twigcs:
service: appserver
cmd: "/app/vendor/friendsoftwig/twigcs"
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "XDebug",
"type": "php",
"request": "launch",
"port": 9003,
"log": false,
"pathMappings": {
"/app/": "${workspaceFolder}/",
}
}
]
}
19 changes: 19 additions & 0 deletions .vscode/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[PHP]

; Xdebug
xdebug.max_nesting_level = 256
xdebug.show_exception_trace = 0
xdebug.collect_params = 0
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_host = ${LANDO_HOST_IP}
xdebug.client_port = 9003
xdebug.log = /app/.vscode/xdebug.log

; Remote settings
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_host = ${LANDO_HOST_IP}
xdebug.remote_port = 9003
; xdebug.remote_connect_back = 1
xdebug.remote_log = /app/.vscode/xdebug_remote.log
30 changes: 30 additions & 0 deletions .vscode/phpcs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/app/vendor/bin
dir=`pwd`
arg=""
for i in "$@"; do
if [[ $i == --stdin-path* ]]; then
find="--stdin-path=${dir}"
replace="--extensions=php,module,inc,install,test,profile,theme,css,info,txt /app"
result=${i//$find/$replace}
i=$result
fi
if [[ $i != "-" ]]; then
arg+=" "$i
fi
done
#echo -e $arg >> phpcs-arg.txt
#echo -e $dir >> phpcs-arg.txt
stdout="$(lando phpcs $arg)"
if [[ $stdout == PHP_CodeSniffer* ]]; then
#echo "${stdout}" >> phpcs-stdout.txt
echo "${stdout}"
else
#echo "${stdout}" >> phpcs-stdout.txt
str="\/app"
appdir=${dir//"/"/"\/"}
swap=${appdir:1}
json=${stdout//$str/$swap}
#echo $json >> phpcs-stdout.txt
echo $json
fi
41 changes: 41 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"editor.rulers": [],
"editor.tabSize": 2,
"editor.insertSpaces": true,
/* PHP Specific configurations */
"phpcs.enable": true,
"phpcs.standard": "Drupal,DrupalPractice",
"phpcs.composerJsonPath": "./composer.json",
"phpcs.executablePath": "./.vscode/phpcs.sh",
"phpcs.autoConfigSearch": false,
"phpcs.trace.server": "verbose",
"phpcs.showSources": true,
"php-docblocker.gap": true,
"php-docblocker.useShortNames": true,
"[php]": {
"editor.autoIndent": "full",
"editor.detectIndentation": true,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true
},
/* End of PHP Configuration */
"files.associations": {
"*.inc": "php",
"*.module": "php",
"*.install": "php",
"*.theme": "php",
"*.tpl.php": "php",
"*.test": "php",
"*.php": "php"
},
"emmet.includeLanguages": {
"twig": "html"
},
"twigcs.executablePath": "./.vscode/twigcs.sh",
"twigcs.enable": true,
"twigcs.enabledWarning": true,
"[git-commit]": {
"editor.rulers": [],
"workbench.editor.restoreViewState": false
}
}
12 changes: 12 additions & 0 deletions .vscode/twigcs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/app/vendor/bin
input=$1
#echo -e "Input $input" >> phpcs-log.txt
dir=`pwd`
#echo -e "Directory $dir" >> phpcs-log.txt
app="/app"
path=${input//$dir/$app}
#echo -e "Replaced $path" >> phpcs-log.txt
output="$(lando twigcs $path)"
#echo "Output $output" >> phpcs-log.txt
echo "/$output"
35 changes: 33 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,17 @@
"minimum-stability": "dev",
"prefer-stable": true,
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"civicrm/composer-compile-plugin": true,
"civicrm/composer-downloads-plugin": true,
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"civicrm/civicrm-asset-plugin": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true
}
},
"extra": {
"drupal-scaffold": {
Expand Down Expand Up @@ -115,6 +125,27 @@
"pre-install-cmd": "git config --global core.autocrlf input"
},
"require-dev": {
"drush/drush": "^10.3"
"behat/mink": "^1.10",
"behat/mink-selenium2-driver": "^1.6",
"civicrm/cv": "^0.3.19",
"drupal/coder": "^8.3",
"drupal/group": "^1.4",
"drush/drush": "^10.3",
"easyrdf/easyrdf": "^1.1",
"friends-of-behat/mink-browserkit-driver": "^1.6",
"friendsoftwig/twigcs": "^5.1",
"justinrainbow/json-schema": "^5.2",
"mikey179/vfsstream": "^1.6",
"phpspec/prophecy": "^1.15",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "^9.5",
"symfony/browser-kit": "^6.0",
"symfony/css-selector": "^6.0",
"symfony/dom-crawler": "^6.0",
"symfony/filesystem": "^4",
"symfony/finder": "^4",
"symfony/lock": "^6.0",
"symfony/phpunit-bridge": "^6.0",
"symfony/var-dumper": "^5"
}
}
Loading

0 comments on commit f6b4b75

Please sign in to comment.