You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Windows: start PowerShell with "Run as administrator", then execute `./gradlew.bat environmentHosts --no-daemon`
55
-
52
+
56
53
### Notice for Docker on Windows
57
54
58
55
Ensure having shared folders enabled via GUI:
@@ -73,7 +70,7 @@ As a consequence, if project is located outside of *C:/Users* directory, there i
73
70
74
71
To configure containers to be deployed using Docker Swarm, simply create standard Docker Compose file but with templating (file at path *src/environment/docker-compose.yml.peb*)
75
72
76
-
```yml
73
+
```pebble
77
74
version: "3"
78
75
services:
79
76
httpd:
@@ -114,14 +111,14 @@ Moreover, plugin comes with rich DSL which allows to:
114
111
* run callbacks on each container lifecycle event (resolve, up, reload, dev),
115
112
* configure where container resources are stored,
116
113
* configure health checks to be able to detect moment in build lifecycle when are container services are stable and be ready to perform next build tasks using these services,
117
-
* configure hosts which should be apended to OS-specific hosts file.
114
+
* configure hosts which should be appended to OS-specific hosts file.
118
115
119
116
```kotlin
120
117
environment { // config for AEM environment running on Docker
hosts { // domains to be appended to hosts file automatically
123
120
"http://example.com" { tag("publish") }
124
-
"http://locahost:4502 { tag("author") }
121
+
"http://locahost:4502" { tag("author") }
125
122
}
126
123
docker { // Docker specific configuration
127
124
containers {
@@ -210,26 +207,28 @@ Reloads virtualized environment by reloading all Docker containers (e.g. removin
210
207
211
208
## Task `environmentHosts`
212
209
213
-
Prints hosts entries to be appended to OS-specific file.
210
+
Amends hosts entries in OS-specific file.
214
211
215
212
Example configuration:
216
213
217
214
```kotlin
218
215
environment {
219
216
hosts { // domains to be appended to hosts file automatically
220
-
"http://example.com" { tag("live site") }
221
-
"http://locahost:4502" { tag("cms authoring") }
222
-
"http://locahost:8080" { tag("dbms") }
217
+
"example.com" { tag("live site") }
218
+
"demo.example.com" { tag("demo site") }
219
+
"cms" { tag("cms authoring") }
223
220
}
224
221
}
225
222
```
226
223
227
-
Result of running task `environmentHosts` will be an list of IP-domain pairs which should be appended to OS-specific file (e.g /etc/hosts on Unix). When using Docker Toolbox on Windows, IP may be different, as of it is using extra VM to run Docker and IP of that VM should be used instead of loopback IP (localhost / 127.0.0.1). Plugin is trying to make this difference transparent for build users.
224
+
The task will run on Windows & Mac OS interactive process asking for administrative/sudo permissions to be able to edit the hosts file.
225
+
On other OSes / Unix-based systems, the task will print a path to the generated script to be executed with sudo rights but in a non-interactive way (to be done separately right after this task execution.
228
226
229
-
Consider creating scripts which will run this task and amend output to OS-specific hosts file automatically with requesting admin/sudo permissions. See examples for:
-`hosts.updater.enabled=false` - allows to disable temporarily host amendmend (e.g on CI/CD),
230
+
-`hosts.updater.interactive=false` - potentially useful when interactive mode does not work for unknown/OS-specific reason,
231
+
-`hosts.updater.force=true` - by default, updater is lazy - it will not ask for administrative/sudo mode if the hosts file does not need to be updated.
0 commit comments