Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use lupus decoupled recipe. #17

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions .ddev/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: lupus-decoupled
type: drupal
type: drupal11
arthurlorenz marked this conversation as resolved.
Show resolved Hide resolved
docroot: web
php_version: "8.3"
webserver_type: nginx-fpm
Expand All @@ -15,7 +15,7 @@ database:
hooks:
post-start:
- exec: |
[[ -d frontend ]] || git clone ${FRONTEND_REPOSITORY:-https://github.com/drunomics/lupus-decoupled-nuxt3-demo} --branch=${FRONTEND_BRANCH:-main} frontend
[[ -d frontend ]] || git clone ${FRONTEND_REPOSITORY:-https://github.com/drunomics/lupus-decoupled-nuxt3-demo-shadcn.git} --branch=${FRONTEND_BRANCH:-main} frontend
cd frontend && npm i
set -x
pm2 start "npm run dev"
Expand All @@ -25,7 +25,7 @@ web_environment:
- NUXT_HOST=0.0.0.0
- NUXT_PORT=3000
- PHAPP_ENV_MODE=development
nodejs_version: "18"
nodejs_version: "22"
corepack_enable: false
web_extra_exposed_ports:
- name: lupus-nuxt
Expand All @@ -38,14 +38,13 @@ web_extra_exposed_ports:
# name: <projectname> # Name of the project, automatically provides
# http://projectname.ddev.site and https://projectname.ddev.site

# type: <projecttype> # backdrop, craftcms, django4, drupal, drupal6, drupal7, laravel, magento, magento2, php, python, shopware6, silverstripe, typo3, wordpress
# type: <projecttype> # backdrop, cakephp, craftcms, drupal, drupal6, drupal7, drupal8, drupal9, drupal10, drupal11, laravel, magento, magento2, php, shopware6, silverstripe, symfony, typo3, wordpress
# See https://ddev.readthedocs.io/en/stable/users/quickstart/ for more
# information on the different project types
# "drupal" covers recent Drupal 8+

# docroot: <relative_path> # Relative path to the directory containing index.php.

# php_version: "8.2" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3", "8.4"
# php_version: "8.3" # PHP version to use, "5.6" through "8.4"

# You can explicitly specify the webimage but this
# is not recommended, as the images are often closely tied to DDEV's' behavior,
Expand All @@ -58,7 +57,7 @@ web_extra_exposed_ports:
# version: <version> # database version, like "10.11" or "8.0"
# MariaDB versions can be 5.5-10.8, 10.11, and 11.4.
# MySQL versions can be 5.5-8.0.
# PostgreSQL versions can be 9-16.
# PostgreSQL versions can be 9-17.

# router_http_port: <port> # Port to be used for http (defaults to global configuration, usually 80)
# router_https_port: <port> # Port for https (defaults to global configuration, usually 443)
Expand All @@ -73,9 +72,11 @@ web_extra_exposed_ports:
# "ddev xhprof" to enable Xhprof and "ddev xhprof off" to disable it work better,
# as leaving Xhprof enabled all the time is a big performance hit.

# webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn
# webserver_type: nginx-fpm or apache-fpm

# timezone: Europe/Berlin
# If timezone is unset, DDEV will attempt to derive it from the host system timezone
# using the $TZ environment variable or the /etc/localtime symlink.
# This is the timezone used in the containers and by PHP;
# it can be set to any valid timezone,
# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Expand All @@ -95,9 +96,9 @@ web_extra_exposed_ports:
# - preview
# - snapshot
# Alternatively, an explicit Composer version may be specified, for example "2.2.18".
# To reinstall Composer after the image was built, run "ddev debug refresh".
# To reinstall Composer after the image was built, run "ddev debug rebuild".

# nodejs_version: "20"
# nodejs_version: "22"
# change from the default system Node.js version to any other version.
# See https://ddev.readthedocs.io/en/stable/users/configuration/config/#nodejs_version for more information
# and https://www.npmjs.com/package/n#specifying-nodejs-versions for the full documentation,
Expand Down Expand Up @@ -223,8 +224,8 @@ web_extra_exposed_ports:

# You can inject environment variables into the web container with:
# web_environment:
# - SOMEENV=somevalue
# - SOMEOTHERENV=someothervalue
# - SOMEENV=somevalue
# - SOMEOTHERENV=someothervalue

# no_project_mount: false
# (Experimental) If true, DDEV will not mount the project into the web container;
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ tasks:
[[ -z $CUSTOM_ELEMENTS_VERSION ]] || ddev composer require drupal/custom_elements:$CUSTOM_ELEMENTS_VERSION --no-update
ddev composer install
ddev drush si -y --site-name='lupus decoupled' standard
ddev drush en lupus_decoupled, services_env_parameter -y
ddev drush recipe ../recipes/lupus_decoupled_recipe -y
# Configure lupus-decoupled frontend base URL
ddev drush config:set lupus_decoupled_ce_api.settings frontend_base_url $(gp url 3000) -y
echo "[NOTE] Setting default admin password for easy testing: lupus123"
Expand Down
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ Optionally, customize the project:

To spin up the project locally run:

# (Optional) For an automated frontend login, set a shared parent domain:
ddev config --web-environment-add="DRUPAL_SERVICE_session__storage__options___cookie_domain=.ddev.site"

ddev start
ddev composer install
ddev composer unpack drupal/lupus_decoupled_recipe
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 recipe ../recipes/lupus_decoupled_recipe
ddev drush cr
# Login and get started
ddev drush upwd admin somepass
ddev launch /user/login

Expand Down
29 changes: 21 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@
{
"type": "composer",
"url": "https://packages.drupal.org/8"
},
{
"type": "vcs",
"url": "https://gitlab.ewdev.ca/yonas.legesse/drupal-recipe-unpack.git"
}
],
"require": {
"composer/installers": "^1.9",
"composer/installers": "^2.3",
"cweagans/composer-patches": "^1.7",
"drupal/core-composer-scaffold": "^11",
"drupal/core-project-message": "^11",
"drupal/core-recommended": "^11",
"drupal/lupus_decoupled": "1.x-dev",
"drupal/rest_log": "^2.3",
"drupal/core-composer-scaffold": "^11.1.0-rc1",
"drupal/core-project-message": "^11.1.0-rc1",
"drupal/core-recommended": "^11.1.0-rc1",
"drupal/drupal_cms_starter": "^1.0@RC",
"drupal/lupus_decoupled_recipe": "1.0.x-dev",
"drupal/responsive_preview": "^2.2",
"drupal/rest_log": "^2.3",
"drupal/schema_metatag": "^3.0",
"drupal/services_env_parameter": "^1.3",
"drush/drush": "^13"
"drush/drush": "^13",
"ewcomposer/unpack": "dev-master"
arthurlorenz marked this conversation as resolved.
Show resolved Hide resolved
},
"conflict": {
"drupal/drupal": "*"
Expand All @@ -40,11 +46,12 @@
"allow-plugins": {
"composer/installers": true,
"cweagans/composer-patches": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"drupal/core-composer-scaffold": true,
"drupal/core-project-message": true,
"ewcomposer/unpack": true,
"php-http/discovery": true,
"phpstan/extension-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"tbachert/spi": true
}
},
Expand All @@ -60,6 +67,9 @@
}
},
"installer-paths": {
"recipes/lupus_decoupled_recipe_base": [
"drupal/lupus_decoupled_recipe"
],
"web/core": [
"type:drupal-core"
],
Expand All @@ -69,6 +79,9 @@
"web/modules/contrib/{$name}": [
"type:drupal-module"
],
"recipes/{$name}": [
"type:drupal-recipe"
],
"web/profiles/contrib/{$name}": [
"type:drupal-profile"
],
Expand Down
1 change: 1 addition & 0 deletions recipes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.txt
3 changes: 3 additions & 0 deletions recipes/lupus_decoupled_recipe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Lupus Decoupled Drupal Project Recipe

A Drupal recipe to setup the base project.
arthurlorenz marked this conversation as resolved.
Show resolved Hide resolved
8 changes: 8 additions & 0 deletions recipes/lupus_decoupled_recipe/recipe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Lupus Decoupled Drupal Project
type: Lupus Decoupled Drupal
description: A recipe to setup a Lupus Decoupled Drupal project.
recipes:
- drupal_cms_starter
- lupus_decoupled_recipe_base
install:
- services_env_parameter