diff --git a/docs/dev_tools/debug.md b/docs/dev_tools/debug.md new file mode 100644 index 0000000000000000000000000000000000000000..e668173ac2e3548ed64b5155428ee45e8e7cf93c --- /dev/null +++ b/docs/dev_tools/debug.md @@ -0,0 +1,53 @@ +--- +title: Debugging +tags: +- documentation +- tools +--- + +# Debugging Drupal Code + +## Add a PHP Server + +First, you have to set up a Drupal environment with the tool [l3d](../docker/l3d/index.md). The tool is +based on Docker containers. + +Now navigate to File->Settings in your IDE and create a server: + + + +Set the following values: + + + +**Important: Always use Docker as name of your server.** + +Do not forget to add the file mapping to `/var/www/html`. + +## Add a new Run/Debug Configuration + + + +First create a new `PHP Web Page` configuration: + + + +Set the following values: + + + +Select the server you just have created. + +**Important: Always use Docker as name of your configuration.** + +## Start Debugging + +First, check the debug settings in your IDE. It should look something like this: + + + +Now activate the `Phone` icon in your IDE: + + + +Now you can set your breakpoints and enjoy debugging Drupal code. diff --git a/docs/dev_tools/host.md b/docs/dev_tools/host.md new file mode 100644 index 0000000000000000000000000000000000000000..7333e70361b6aa780a7f2fd759b233f46ed490ca --- /dev/null +++ b/docs/dev_tools/host.md @@ -0,0 +1,100 @@ +--- +title: Host setup +tags: +- documentation +- tools +--- +# Host setup + +## Recommended files in developer's HOME directory + +### ~/.env + +```dotenv +COMPOSER_DOWNGRADE=0 +DOCKER4DRUPAL_LIVE_HOST_USERNAME=YOURNAME +DOCKER4DRUPAL_TRAEFIK_CERT=fullchain.pem +DOCKER4DRUPAL_TRAEFIK_DOMAIN=docker.localhost +DOCKER4DRUPAL_TRAEFIK_KEY=privkey.pem +DOCKER4DRUPAL_TRAEFIK_PORT=80 +DOCKER4DRUPAL_TRAEFIK_PORTAINER=1 +DOCKER4DRUPAL_TRAEFIK_PORTS=443 +DOCKER4DRUPAL_TRAEFIK_USESSL=0 +DORGFLOW=0 +DRUPAL_LIVE=0 +MAILHOG_HOST=smtp.freesmtpservers.com +MAILHOG_MECHANISM=NONE +MAILHOG_PASSWORD= +MAILHOG_PORT=25 +MAILHOG_USERNAME= +PHP_DEBUG=0 +PHP_VERSION=7.4 +WEBSERVER_CONFIG_OVERWRITE=0 +``` + +### ~/.gitconfig + +```editorconfig +[user] + name = YOURNAME + email = YOUREMAIL +[core] + autocrlf = input + excludesfile = ~/.gitignore_global +[push] + default = simple +[filter "lfs"] + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + required = true + process = git-lfs filter-process +[credential] + helper = cache --timeout=3600 +[init] + templatedir = ~/.git-templates +``` + +### ~/.gitignore_global + +```gitignore +.idea/ +*.iml +test.http +``` + +### ~/.composer/auth.json + +```json +{ + "http-basic": { + "git.drupalcode.org": { + "username": "YOURNAME", + "password": null + } + }, + "github-oauth": { + "github.com": "YOURTOKEN" + }, + "gitlab-oauth": {}, + "gitlab-token": { + "gitlab.lakedrops.com": "YOURTOKEN", + "gitlab.com": "YOURTOKEN", + "git.drupalcode.org": "YOURTOKEN" + } +} +``` + +### ~/.docker/config.json + +```json +{ + "auths": { + "registry.gitlab.com": { + "auth": "YOURAUTH" + }, + "registry.lakedrops.com": { + "auth": "YOURAUTH" + } + } +} +``` diff --git a/docs/dev_tools/index.md b/docs/dev_tools/index.md index 8223adbd4b2d479f76958e62bf7a3df5912977ec..02c942dbfcef272f95753bc38b9d90d01b1fd61c 100644 --- a/docs/dev_tools/index.md +++ b/docs/dev_tools/index.md @@ -10,54 +10,3 @@ tags: We use the IDE's IntelliJ and PHPStorm from [Jetbrains](https://jetbrains.com), because we are convinced to use best toolset in the market so far. - -## Debugging Drupal Code - -### Add a PHP Server - -First, you have to set up a Drupal environment with the tool [l3d](../docker/l3d/index.md). The tool is -based on Docker containers. - -Now navigate to File->Settings in your IDE and create a server: - - - -Set the following values: - - - -**Important: Always use Docker as name of your server.** - -Do not forget to add the file mapping to `/var/www/html`. - -### Add a new Run/Debug Configuration - - - -First create a new `PHP Web Page` configuration: - - - -Set the following values: - - - -Select the server you just have created. - -**Important: Always use Docker as name of your configuration.** - -### Start Debugging - -First, check the debug settings in your IDE. It should look something like this: - - - -Now activate the `Phone` icon in your IDE: - - - -Now you can set your breakpoints and enjoy debugging Drupal code. - -## Execute Drupal tests within your IDE - - diff --git a/docs/dev_tools/test.md b/docs/dev_tools/test.md new file mode 100644 index 0000000000000000000000000000000000000000..5f9239d15f8813f5283d02caeb5f180558375c52 --- /dev/null +++ b/docs/dev_tools/test.md @@ -0,0 +1,8 @@ +--- +title: Testing +tags: +- documentation +- tools +--- + +# Testing Drupal Code diff --git a/mkdocs.yml b/mkdocs.yml index 3dbbab89e4d707b0888dee9952cc6104bcf3602c..0b2a9a9fe2150a98311ec4e8ed93aa3ce8146ced 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -226,3 +226,6 @@ nav: - Tools: devops/alm/tools.md - Developer Tools: - Home: dev_tools/index.md + - Host Setup: dev_tools/host.md + - Debugging: dev_tools/debug.md + - Testing: dev_tools/test.md