From 5ba22706b1e54a3aeb3dbf10d2eaf92d78923146 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrgen=20Haas?= <jurgen.haas@lakedrops.com>
Date: Sun, 27 Feb 2022 17:46:49 +0100
Subject: [PATCH] Describe recommended setup for developer's HOME directory

---
 docs/dev_tools/debug.md |  53 +++++++++++++++++++++
 docs/dev_tools/host.md  | 100 ++++++++++++++++++++++++++++++++++++++++
 docs/dev_tools/index.md |  51 --------------------
 docs/dev_tools/test.md  |   8 ++++
 mkdocs.yml              |   3 ++
 5 files changed, 164 insertions(+), 51 deletions(-)
 create mode 100644 docs/dev_tools/debug.md
 create mode 100644 docs/dev_tools/host.md
 create mode 100644 docs/dev_tools/test.md

diff --git a/docs/dev_tools/debug.md b/docs/dev_tools/debug.md
new file mode 100644
index 0000000..e668173
--- /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:
+
+![Screenshot](/files/screenshots/settings_php_new_server.png)
+
+Set the following values:
+
+![Screenshot](/files/screenshots/settings_php_add_server.png)
+
+**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
+
+![Screenshot](/files/screenshots/configuration_add.png)
+
+First create a new `PHP Web Page` configuration:
+
+![Screenshot](/files/screenshots/configuration_new_webpage.png)
+
+Set the following values:
+
+![Screenshot](/files/screenshots/configuration_done.png)
+
+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:
+
+![Screenshot](/files/screenshots/settings_php_debug.png)
+
+Now activate the `Phone` icon in your IDE:
+
+![Screenshot](/files/screenshots/start_debug.png)
+
+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 0000000..7333e70
--- /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 8223adb..02c942d 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:
-
-![Screenshot](/files/screenshots/settings_php_new_server.png)
-
-Set the following values:
-
-![Screenshot](/files/screenshots/settings_php_add_server.png)
-
-**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
-
-![Screenshot](/files/screenshots/configuration_add.png)
-
-First create a new `PHP Web Page` configuration:
-
-![Screenshot](/files/screenshots/configuration_new_webpage.png)
-
-Set the following values:
-
-![Screenshot](/files/screenshots/configuration_done.png)
-
-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:
-
-![Screenshot](/files/screenshots/settings_php_debug.png)
-
-Now activate the `Phone` icon in your IDE:
-
-![Screenshot](/files/screenshots/start_debug.png)
-
-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 0000000..5f9239d
--- /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 3dbbab8..0b2a9a9 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
-- 
GitLab