From 53deb49e0d4e2fae132b6c975053e77c0b356ea9 Mon Sep 17 00:00:00 2001 From: Ofer Shaal Date: Wed, 15 Dec 2021 23:01:13 -0500 Subject: [PATCH] ddev v1.18.2 with native gitpod support --- .gitpod.yml | 26 +++++++++------------- .gitpod/scripts/ddev-setup.sh | 42 +++++------------------------------ 2 files changed, 15 insertions(+), 53 deletions(-) diff --git a/.gitpod.yml b/.gitpod.yml index a56c559..16754c1 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,10 +1,8 @@ -image: - file: .gitpod/Dockerfile +image: drupalpod/drupalpod-gitpod-base:20211116-ready-made-envs tasks: - init: | # Installing DDev and Drupal backend. - .gitpod/scripts/ddev-download-images.sh .gitpod/scripts/ddev-setup.sh .gitpod/scripts/drupal-setup.sh # Installing Nuxt/Druxt frontend. @@ -37,24 +35,20 @@ ports: - port: 3003 onOpen: ignore visibility: public - - # Currently un-notified and unsupported mailhog http port - - port: 8025 + # Used by ddev - local db clients + - port: 3306 onOpen: ignore - # Currently un-notified and unsupported mailhog https port - - port: 8026 + # Used by MailHog + - port: 8027 onOpen: ignore - # Currently un-notified and unsupported phpmyadmin http port + # Used by phpMyAdmin - port: 8036 onOpen: ignore - # Currently un-notified and unsupported phpmyadmin https port - - port: 8037 - onOpen: ignore - # router http port that we're ignoring. - - port: 8888 + # Direct-connect ddev-webserver port that is the main port + - port: 8080 onOpen: ignore - # router https port that we're ignoring. - - port: 8889 + # Ignore host https port + - port: 8443 onOpen: ignore # xdebug port - port: 9000 diff --git a/.gitpod/scripts/ddev-setup.sh b/.gitpod/scripts/ddev-setup.sh index b82c5fb..4d697f4 100755 --- a/.gitpod/scripts/ddev-setup.sh +++ b/.gitpod/scripts/ddev-setup.sh @@ -1,45 +1,13 @@ #!/usr/bin/env bash +# Download ddev's images +ddev debug download-images + # Set up ddev for use on gitpod DRUPAL_DIR="${GITPOD_REPO_ROOT}/drupal" -DDEV_DIR="${DRUPAL_DIR}/.ddev" - -# Generate a config.gitpod.yaml that adds the gitpod -# proxied ports so they're known to ddev. -shortgpurl="${GITPOD_WORKSPACE_URL#'https://'}" - -cat < "${DDEV_DIR}"/config.gitpod.yaml -#ddev-gitpod-generated -php_version: "7.4" -bind_all_interfaces: true -host_webserver_port: 8080 -# Will ignore the direct-bind https port, which will land on 2222 -host_https_port: 2222 -# Allows local db clients to run -host_db_port: 3306 -# Assign MailHog port -host_mailhog_port: 8025 -# Assign phpMyAdmin port -host_phpmyadmin_port: 8036 -CONFIGEND - -# We need host.docker.internal inside the container, -# So add it via docker-compose.host-docker-internal.yaml -hostip=$(awk "\$2 == \"$HOSTNAME\" { print \$1; }" /etc/hosts) - -cat <"${DDEV_DIR}"/docker-compose.host-docker-internal.yaml -#ddev-gitpod-generated -version: "3.6" -services: - web: - environment: - - DRUSH_OPTIONS_URI=$(gp url 8080) - extra_hosts: - - "host.docker.internal:${hostip}" -COMPOSEEND # Misc housekeeping before start -ddev config global --instrumentation-opt-in=true --omit-containers=ddev-router +ddev config global --instrumentation-opt-in=true # Start ddev -cd $DRUPAL_DIR && ddev start +cd $DRUPAL_DIR && ddev start -y