Skip to content

Commit 549cc89

Browse files
authored
Merge pull request #1 from shaal/ddev-gitpod-update
ddev v1.18.2 with native gitpod support
2 parents 7c04a30 + 53deb49 commit 549cc89

File tree

2 files changed

+15
-53
lines changed

2 files changed

+15
-53
lines changed

.gitpod.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
image:
2-
file: .gitpod/Dockerfile
1+
image: drupalpod/drupalpod-gitpod-base:20211116-ready-made-envs
32

43
tasks:
54
- init: |
65
# Installing DDev and Drupal backend.
7-
.gitpod/scripts/ddev-download-images.sh
86
.gitpod/scripts/ddev-setup.sh
97
.gitpod/scripts/drupal-setup.sh
108
# Installing Nuxt/Druxt frontend.
@@ -37,24 +35,20 @@ ports:
3735
- port: 3003
3836
onOpen: ignore
3937
visibility: public
40-
41-
# Currently un-notified and unsupported mailhog http port
42-
- port: 8025
38+
# Used by ddev - local db clients
39+
- port: 3306
4340
onOpen: ignore
44-
# Currently un-notified and unsupported mailhog https port
45-
- port: 8026
41+
# Used by MailHog
42+
- port: 8027
4643
onOpen: ignore
47-
# Currently un-notified and unsupported phpmyadmin http port
44+
# Used by phpMyAdmin
4845
- port: 8036
4946
onOpen: ignore
50-
# Currently un-notified and unsupported phpmyadmin https port
51-
- port: 8037
52-
onOpen: ignore
53-
# router http port that we're ignoring.
54-
- port: 8888
47+
# Direct-connect ddev-webserver port that is the main port
48+
- port: 8080
5549
onOpen: ignore
56-
# router https port that we're ignoring.
57-
- port: 8889
50+
# Ignore host https port
51+
- port: 8443
5852
onOpen: ignore
5953
# xdebug port
6054
- port: 9000

.gitpod/scripts/ddev-setup.sh

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,13 @@
11
#!/usr/bin/env bash
22

3+
# Download ddev's images
4+
ddev debug download-images
5+
36
# Set up ddev for use on gitpod
47
DRUPAL_DIR="${GITPOD_REPO_ROOT}/drupal"
5-
DDEV_DIR="${DRUPAL_DIR}/.ddev"
6-
7-
# Generate a config.gitpod.yaml that adds the gitpod
8-
# proxied ports so they're known to ddev.
9-
shortgpurl="${GITPOD_WORKSPACE_URL#'https://'}"
10-
11-
cat <<CONFIGEND > "${DDEV_DIR}"/config.gitpod.yaml
12-
#ddev-gitpod-generated
13-
php_version: "7.4"
14-
bind_all_interfaces: true
15-
host_webserver_port: 8080
16-
# Will ignore the direct-bind https port, which will land on 2222
17-
host_https_port: 2222
18-
# Allows local db clients to run
19-
host_db_port: 3306
20-
# Assign MailHog port
21-
host_mailhog_port: 8025
22-
# Assign phpMyAdmin port
23-
host_phpmyadmin_port: 8036
24-
CONFIGEND
25-
26-
# We need host.docker.internal inside the container,
27-
# So add it via docker-compose.host-docker-internal.yaml
28-
hostip=$(awk "\$2 == \"$HOSTNAME\" { print \$1; }" /etc/hosts)
29-
30-
cat <<COMPOSEEND >"${DDEV_DIR}"/docker-compose.host-docker-internal.yaml
31-
#ddev-gitpod-generated
32-
version: "3.6"
33-
services:
34-
web:
35-
environment:
36-
- DRUSH_OPTIONS_URI=$(gp url 8080)
37-
extra_hosts:
38-
- "host.docker.internal:${hostip}"
39-
COMPOSEEND
408

419
# Misc housekeeping before start
42-
ddev config global --instrumentation-opt-in=true --omit-containers=ddev-router
10+
ddev config global --instrumentation-opt-in=true
4311

4412
# Start ddev
45-
cd $DRUPAL_DIR && ddev start
13+
cd $DRUPAL_DIR && ddev start -y

0 commit comments

Comments
 (0)