-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from orodicio/feature/0-update-readme-md
Issue #0: Updated readme.md
- Loading branch information
Showing
1 changed file
with
186 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,8 +40,139 @@ Launch Aljibe Assistant. This will guide you throught the basic Drupal site inst | |
|
||
You are ready! you will have a new Drupal project based on Aljibe ready for development. | ||
|
||
## Transform project from boilerplate to ddev | ||
|
||
## Other Aljibe commands | ||
- Create folder ddev-addons, it will contain all ddev project necessary to build the ddev project: | ||
``` | ||
mkdir ddev-addons | ||
``` | ||
- Clone [Aljibe assistant](https://gitlab.metadrop.net/metadrop-group/ddev-aljibe-assistant) and [Aljibe](https://gitlab.metadrop.net/metadrop-group/ddev-aljibe) on ddev-addons: | ||
|
||
``` | ||
cd ddev-addons/ | ||
git clone [email protected]:metadrop-group/ddev-aljibe-assistant.git | ||
git clone [email protected]:metadrop-group/ddev-aljibe.git | ||
``` | ||
|
||
- Create a new folder to create the ddev project: | ||
|
||
``` | ||
cd ../ | ||
mkdir my-new-project | ||
``` | ||
|
||
- From the new folder run the following command: | ||
``` | ||
ddev config --project-type=drupal10 --docroot 'web' --auto && ddev get ../ddev-addons/ddev-aljibe | ||
``` | ||
- Remove the folder .ddev/aljibe-kickstart/ | ||
- Clone the old project without install the site, to avoid folders like contrib modules/themes or vendor | ||
- Copy all the code from the old project to the new folder. | ||
- Create a new branch. | ||
- Add .ddev | ||
- Remove the .env file | ||
- Create an empty .env file on .ddev folder | ||
- Add settings.ddev*.php to .gitignore | ||
- Adapt the settings.php to include the settings.ddev.php: | ||
|
||
``` | ||
// Automatically generated include for settings managed by ddev. | ||
$ddev_settings = dirname(__FILE__) . '/settings.ddev.php'; | ||
if (getenv('IS_DDEV_PROJECT') == 'true' && is_readable($ddev_settings)) { | ||
require $ddev_settings; | ||
} | ||
``` | ||
|
||
- Remove from settings.local.php database, trusted host patterns and others that can conflict with settings.ddev.php. | ||
- Adapt the drush alias to the new url. Here's an example: | ||
|
||
``` | ||
# Local environment | ||
# BEGIN dev alias | ||
local: | ||
uri: 'https://yoursite.ddev.site' | ||
root: '/var/www/html' | ||
# END dev alias | ||
# dev environment. | ||
# BEGIN dev alias | ||
dev: | ||
uri: 'https://yoursite-dev' | ||
root: 'yourserverpath' | ||
host: 'yoursite-dev' | ||
user: 'yourserveruser' | ||
paths: | ||
drush-script: 'yourserverpath/vendor/bin/drush' | ||
# END dev alias | ||
# stg environment. | ||
# BEGIN stg alias | ||
stg: | ||
uri: 'https://yoursite-stg' | ||
root: 'yourserverpath' | ||
host: 'yoursite-stg' | ||
user: 'yourserveruser' | ||
paths: | ||
drush-script: 'yourserverpath/vendor/bin/drush' | ||
# END stg alias | ||
# BEGIN pro alias | ||
pro: | ||
uri: 'https://yoursite.com' | ||
root: 'yourserverpath' | ||
host: 'yoursite.com' | ||
user: 'yourserveruser' | ||
paths: | ||
drush-script: 'yourserverpath/vendor/bin/drush' | ||
# END pro alias | ||
``` | ||
|
||
- Update the **sites/default/local.drush.yml** with the new domain | ||
- Add the extra services (memcache, varnish, solr…) | ||
|
||
``` | ||
# List the available services | ||
ddev get list | ||
# Get a service | ||
ddev get ddev/ddev-memcached | ||
``` | ||
|
||
- Configure on .env variables as solr: | ||
|
||
``` | ||
SOLR_CORENAME: default | ||
``` | ||
|
||
- Replace http://apache or http://nginx by http://web | ||
- Install certs, this only needs to be launched if after open the website on a browser says that the site is unsafe: | ||
``` | ||
mkcert --install | ||
``` | ||
- Add to config.yml to ddev the THEME_PATH: | ||
``` | ||
web_environment: | ||
- THEME_PATH=/var/www/html/web/themes/custom/your_theme | ||
``` | ||
- Config also the nodejs_version with the same as the old project. Old version on .env file, variable **“NODE_TAG”** | ||
Review the min node tag | ||
``` | ||
nodejs_version: "16" | ||
``` | ||
- Config the theme and the sites on .ddev/aljibe.yaml: | ||
``` | ||
theme_paths: | ||
your_theme: /var/www/html/web/themes/custom/your_theme | ||
``` | ||
- Adapt grumphp changing EXEC_GRUMPHP_COMMAND on grumphp.yml to “ddev exec” | ||
- Launch ddev setup: | ||
- If monosite: `ddev setup` | ||
- If multisite:`ddev setup —all` or `ddev setup --sites=site1` | ||
- If the site is not installed use `ddev drush -- si --existing-config -y` | ||
- Or import an existing database: `ddev import-db --file=./tmp/db.sql.gz` | ||
- Ignore settings.ddev.php from .gitignore | ||
## Aljibe commands | ||
#### Project setup | ||
Once the project has been created and uploaded to version control, anyone else working with it can clone it and with the following command you can have the project ready to work with. | ||
|
@@ -79,6 +210,10 @@ If you use ddev-solr addon and need to sync the solr config from the server, you | |
ddev solr-sync | ||
#### Power off ddev | ||
ddev poweroff | ||
## Troubleshooting | ||
### Https not working | ||
|
@@ -114,3 +249,53 @@ xdebug.profiler_output_name=trace.%c%p%r%u.out | |
``` | ||
Review the php info (/admin/reports/status/php) page to review that the xdebug variables are setup properly after run ddev xdebug on, restart the project if necessary. | ||
## How to develop Aljibe | ||
To work on the development of Aljibe, if we do a lot of tests we can reach the limit of github, so it is convenient to have everything in local. For this we should have a structure like this: | ||
- tests-aljibe <- Here we test the creation of projects with the steps explained below. This folder can have any name you want. | ||
- ddev-addons <- Here are all the addons from Metadrop: | ||
- ddev-aljibe | ||
- ddev-aljibe-assistant | ||
- ddev-backstopjs | ||
- ddev-lighthouse | ||
- ddev-mkdocs | ||
- ddev-pa11y | ||
- ddev-selenium | ||
To have this folder, we can do the following from the folder where we save the projects: | ||
1. Create the folder and got to that folder: | ||
``` | ||
mkdir ddev-addons && cd ddev-addons | ||
``` | ||
2. Clone the projects: | ||
``` | ||
|
||
git clone [email protected]:metadrop-group/ddev-aljibe.git | ||
git clone [email protected]:metadrop-group/ddev-aljibe-assistant.git | ||
git clone [email protected]:Metadrop/ddev-backstopjs.git | ||
git clone [email protected]:Metadrop/ddev-lighthouse.git | ||
git clone [email protected]:Metadrop/ddev-mkdocs.git | ||
git clone [email protected]:Metadrop/ddev-pa11y.git | ||
git clone [email protected]:Metadrop/ddev-selenium.git | ||
|
||
``` | ||
#### Installing Aljibe: | ||
To launch ddev-aljibe, we must go to the test-aljibe folder, or to the folder where we want to install it. Remember that as long as we don't have Aljibe public, this folder must be at the same level as the ‘ddev-addons’ folder. Inside this folder, just launch these 3 commands: | ||
1. Configure a basic ddev project: | ||
``` | ||
ddev config --auto | ||
``` | ||
2. Install ddev-aljibe from local: | ||
``` | ||
ddev get ../ddev-addons/ddev-aljibe | ||
``` | ||
3. Launch the Aljibe assistant: | ||
``` | ||
ddev aljibe-assistant | ||
``` |