DDEV and Ibexa Cloud¶
Two ways are available to run an Ibexa Cloud project locally with DDEV:
Note
The following examples use Ibexa Cloud CLI (ibexa_cloud
).
With the ddev-platformsh
add-on¶
To configure the ddev/ddev-platformsh
add-on, you need a Platform.sh API Token.
The ddev/ddev-platformsh
add-on configures the document root, the PHP version, the database, and the cache pool according to the Ibexa Cloud configuration.
About the search engine, the add-on can configure Elasticsearch but can't configure Solr.
If you use Solr on Ibexa Cloud and want to add it to your DDEV stack, see Clustering with DDEV and ibexa/ddev-solr
add-on.
COMPOSER_AUTH
from Platform.sh can't be used, because JSON commas are incorrectly interpreted by --web-environment-add
, which sees them as multiple variable separators.
But the variable must exist for Platform.sh hooks
scripts to work.
To use an auth.json
file for this purpose, see Using auth.json
.
You must remove Node.js and NVM installations as they're already included in DDEV.
The following sequence of commands:
- Downloads the Ibexa Cloud Platform.sh project from the default environment "production" into a new directory, based on the Platform.sh CLI alias
ibexa_cloud
defined in introduction. (Replace<project-ID>
with the hash of your own project. Seeibexa_cloud help get
for options like selecting another environment). - Configures a new DDEV project.
- Ignores
.ddev/
directory from Git. (Some DDEV config could be committed like in this documentation.) - Sets Composer authentication by using an already existing
auth.json
file. - Creates a
public/var
directory if it doesn't exist, to allow the creation ofpublic/var/.platform.installed
by Platform.sh hook script. - Installs the
ddev/ddev-platformsh
add-on which prompts for the Platform.sh API token, project ID and environment name. - Comments out the Node.js and NVM installations from the hooks copied in
.ddev/config.platformsh.yaml
. (In this file, you may have to discard other specific features like New Relic.) - Changes
maxmemory-policy
from defaultallkeys-lfu
to a value accepted by theRedisTagAwareAdapter
. - Starts the project.
- Gets the content from Platform.sh, both database and binary files by using
ddev pull platform
feature from the add-on. - Restarts the project.
- Displays information about the project services.
- Opens the project in a browser.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Note
The Platform.sh API token is set at user profile level, therefore it's stored globally under current user root as PLATFORMSH_CLI_TOKEN
in ~/.ddev/global_config.yaml
.
Without the Platform.sh add-on¶
The following example adapts the manual method to run an already existing project to the Platform.sh case:
The following sequence of commands:
- Downloads the Ibexa Cloud Platform.sh project from the default environment "production" into a new directory, based on the Platform.sh CLI alias
ibexa_cloud
defined in introduction. (Replace<project-ID>
with the hash of your own project. Seeibexa_cloud help get
for options like selecting another environment). - Configures a new DDEV project.
- Ignores
.ddev/
directory from Git. (Some DDEV config could be committed like in this documentation.) - Starts the DDEV project.
- Sets Composer authentication.
- Gets the database content from Platform.sh.
- Imports this database content into DDEV project's database.
- Downloads the Platform.sh public/var locally to have the content binary files.
- Install the dependencies and run post-install scripts.
- Displays information about the project services.
- Opens the DDEV project in a browser.
1 2 3 4 5 6 7 8 9 10 11 |
|
From there, services can be added to get closer to Ibexa Cloud Platform.sh architecture.
.platform/services.yaml
indicates the services used.
For more information, see Clustering with DDEV.