Skip to content

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 Ibexa Cloud add-ons

To configure ddev/ddev-platformsh add-on and ddev/ddev-ibexa-cloud 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.

The ddev/ddev-ibexa-cloud add-on integrates the ibexa_cloud command inside the container, and eases the pull of cloud contents into the local installation.

env: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.

The following sequence of commands:

  1. Downloads the Ibexa Cloud project from the default environment "production" into a new directory (for example my-ddev-project), using the ibexa_cloud command. (Replace <project-ID> with the hash of your own project. See ibexa_cloud help get for options like selecting another environment).
  2. Configures a new DDEV project.
  3. Configures the ddev/ddev-ibexa-cloud add-on with <project-ID>, environment name (for example, production), and application name (for example, app from name: app line in .platform.app.yaml file).
  4. Configures ibexa_cloud command token. See Create an API token for more information.
  5. Ignores .ddev/ directory from Git. (Some DDEV config could be committed like in this documentation.)
  6. Sets Composer authentication by using an already existing auth.json file.
  7. Installs the ddev/ddev-platformsh add-on which prompts for the Platform.sh API token, project ID and environment name.
  8. Changes maxmemory-policy from default allkeys-lfu to a value accepted by the RedisTagAwareAdapter. (Check .ddev/config.platformsh.yaml and adapt if needed. For example, you may have to comment out New Relic.)
  9. Installs the ddev/ddev-ibexa-cloud add-on.
  10. Starts the project.
  11. Gets the content from Ibexa Cloud, both database and binary files by using ddev pull ibexa-cloud feature from the add-on.
  12. Displays information about the project services.
  13. Opens the project in a browser.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
ibexa_cloud project:get <project-ID> my-ddev-project && cd my-ddev-project
ddev config --project-type=php --php-version 8.1 --web-environment-add COMPOSER_AUTH='',DATABASE_URL=mysql://db:db@db:3306/db
ddev config --web-environment-add IBEXA_PROJECT=<project-ID>,IBEXA_ENVIRONMENT=production,IBEXA_APP=app
ddev config --web-environment-add IBEXA_CLI_TOKEN=<api-token>
echo '.ddev/' >> .gitignore
mkdir -p .ddev/homeadditions/.composer && cp <path-to-an>/auth.json .ddev/homeadditions/.composer
ddev add-on get ddev/ddev-platformsh
sed -i 's/maxmemory-policy allkeys-lfu/maxmemory-policy volatile-lfu/' .ddev/redis/redis.conf
ddev add-on get ddev/ddev-ibexa-cloud
ddev start
ddev pull ibexa-cloud -y
ddev describe
ddev launch

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 Ibexa Cloud add-ons

The following example adapts the manual method to run an already existing project to the Platform.sh case:

The following sequence of commands:

  1. Downloads the Ibexa Cloud Platform.sh project from the default environment "production" into a new directory, using the Ibexa Cloud CLI. (Replace <project-ID> with the hash of your own project. See ibexa_cloud help get for options like selecting another environment).
  2. Configures a new DDEV project.
  3. Ignores .ddev/ directory from Git. (Some DDEV config could be committed like in this documentation.)
  4. Starts the DDEV project.
  5. Sets Composer authentication.
  6. Gets the database content from Platform.sh.
  7. Imports this database content into DDEV project's database.
  8. Downloads the Platform.sh public/var locally to have the content binary files.
  9. Install the dependencies and run post-install scripts.
  10. Displays information about the project services.
  11. Opens the DDEV project in a browser.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ibexa_cloud project:get <project-ID> my-ddev-project && cd my-ddev-project
ddev config --project-type=php --php-version 8.1 --docroot=public --web-environment-add DATABASE_URL=mysql://db:db@db:3306/db
echo '.ddev/' >> .gitignore
ddev start
ddev composer config --global http-basic.updates.ibexa.co <installation-key> <token-password>
ibexa_cloud db:dump --gzip --file=production.sql.gz
ddev import-db --file=production.sql.gz && rm production.sql.gz
ibexa_cloud mount:download --mount public/var --target public/var
ddev composer install
ddev describe
ddev launch

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.