ddev / ddev-platformsh

Add integration with Platform.sh hosting service
Apache License 2.0
9 stars 10 forks source link

Improve $PLATFORM_ROUTES to include at least route id and multiple routes, for #95, followup to #47 #103

Closed rfay closed 10 months ago

rfay commented 1 year ago

This does not yet get magento2ce to completion. More work is required. I'll need help. I'm not sure the template is actually using $PLATFORM_ROUTES correctly, as it still tries to connect to redis.internal even when $PLATFORM_ROUTES is properly filled out.

rfay commented 1 year ago

To test this, ddev get https://github.com/rfay/ddev-platformsh/tarball/20230311_platform_routes

rfay commented 10 months ago

Current DDEV is OK with a non-existent routes.yaml

rfay commented 10 months ago

I think this is getting the routes right now!

rfay commented 10 months ago

@gilzow if you could take it for a spin,

ddev get https://github.com/rfay/ddev-platformsh/tarball/20230311_platform_routes

Mostly just validate the $PLATFORM_ROUTES that you find in the container, etc. ddev ssh and use the tools there to look at $PLATFORM_ROUTES

gilzow commented 10 months ago

woooooohhhhoooooo!!!!!!

.platform/routes.yaml

"https://{default}/":
  type: upstream
  id: iamtheid
  upstream: "cyberspace-place-ddev:http"

# A basic redirect definition
# More information: https://docs.platform.sh/define-routes.html#basic-redirect-definition
"https://www.{default}":
  type: redirect
  to: "https://{default}/"

Inside the app?

gilzow@cyberspace-place-ddev-web:/var/www/html$ echo $PLATFORM_ROUTES | base64 --decode | jq '.'
{
  "https://cyberspace-place-ddev.ddev.site/": {
    "primary": true,
    "id": "iamtheid",
    "production_url": "<no value>",
    "attributes": {},
    "upstream": "cyberspace-place-ddev:http",
    "type": "upstream",
    "original_url": "<no value>"
  }
}

💪