A ddev + Gitpod enabled decoupled project template
Use gitpod.io to setup a full Drupal dev environment in a browser.
This project demonstrates a complete Drupal 10 development environment, utilizing ddev and Gitpod, through your browser. Refer to https://gitpod.io/#https://github.com/shaal/ddev-gitpod for usage documentation.
ddev is a ridiculously simple setup for complex development environments, based upon docker compose.
Requirements:
- ddev v1.23 or later. Please follow the installation instructions
Resources:
- .ddev/config.yaml - main ddev (default) configuration, can be generated by running
ddev config
- ddev docs
Optionally, customize the project:
# Configure a different frontend repository.
ddev config --web-environment-add="FRONTEND_REPOSITORY=https://github.com/drunomics/lupus-decoupled-nuxt3-demo"
To spin up the project locally run:
ddev start
ddev composer install
ddev drush site-install -y --account-pass=admin --site-name='lupus_decoupled' standard
ddev drush pm-enable lupus_decoupled, services_env_parameter -y
# Configure lupus-decoupled frontend base URL
ddev drush config:set lupus_decoupled_ce_api.settings frontend_base_url https://lupus-nuxt.ddev.site -y
# Login and get started adding some test-nodes
ddev drush upwd admin somepass
ddev launch /user/login
When using ddev locally the URLs are by default:
- Frontend: https://lupus-nuxt.ddev.site
- Backend: https://lupus-decoupled.ddev.site
For example, to change the repository from nuxt3 to nuxt2 run the following command:
ddev config --web-environment-add="FRONTEND_REPOSITORY=${FRONTEND_REPOSITORY:-https://github.com/drunomics/lupus-decoupled-nuxt-demo}"
In order to setup a shared cookie domain, adjust the cookie_domain option of
Drupal via the services.yml
configuration file, or set the option via
an environment variable via pre-installed servies_env_parameter module. For
that, simply set suiting values for ddev/gitpod at the locations as output
by:
git grep -B 1 DRUPAL_SERVICE_session__storage__options___cookie_domain
The commented values work by default for the Gitpod/ddev setup, but consider the following SECURITY WARNING:
The values suggested are configured to share the session cookie on the shared domain .gitpod.io
by default. This
allows all *.gitpod.io instances to read your session cookie. When using Gitpod for anything else than testing
purposes, use a custom parent domain.
When working on this template, things can be tested best on gitpod by modifying the launch link.
Testing project-template branches
Use the following link and replace <<BRANCH>>
with the actual branch, if it contains slashes, keep
them:
https://gitpod.io/new/#DP_PROJECT_NAME=lupus_decoupled,DP_ISSUE_BRANCH=1.x,DP_PROJECT_TYPE=project_module,DP_MODULE_VERSION=1.x,DP_PATCH_FILE=,FRONTEND_REPOSITORY=https%3A%2F%2Fgithub.com%2Fdrunomics%2Flupus-decoupled-nuxt3-demo,CUSTOM_ELEMENTS_VERSION=3.*,DP_INSTALL_PROFILE=standard/https://github.com/drunomics/lupus-decoupled-project/tree/<<BRANCH>>
Testing frontend repository branches
Use the following link and replace <<BRANCH>>
with the actual branch of the frontend repository that should be used. If it contains slashes, url-encode them by replacing them with %2F
:
https://gitpod.io/new/#DP_PROJECT_NAME=lupus_decoupled,DP_ISSUE_BRANCH=1.x,DP_PROJECT_TYPE=project_module,DP_MODULE_VERSION=1.x,DP_PATCH_FILE=,FRONTEND_REPOSITORY=https%3A%2F%2Fgithub.com%2Fdrunomics%2Flupus-decoupled-nuxt3-demo,FRONTEND_BRANCH=<<BRANCH>>,CUSTOM_ELEMENTS_VERSION=3.*,DP_INSTALL_PROFILE=standard/https://github.com/drunomics/lupus-decoupled-project/tree/main