Skip to content

Commit ee1ee68

Browse files
committed
IBX-9395: ddev-ibexa-cloud add-on (#2599)
(cherry picked from commit e9d13fb)
1 parent 5eaa26c commit ee1ee68

File tree

4 files changed

+40
-25
lines changed

4 files changed

+40
-25
lines changed
83.7 KB
Loading
-19.5 KB
Binary file not shown.

docs/ibexa_cloud/ddev_and_ibexa_cloud.md

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,59 +6,62 @@ description: Use DDEV to run an Ibexa Cloud project locally.
66

77
Two ways are available to run an [[= product_name_cloud =]] project locally with DDEV:
88

9-
- [by using the Platform.sh's `ddev-platformsh` add-on](#with-the-ddev-platformsh-add-on)
10-
- [like other existing project, without this add-on](#without-the-platformsh-add-on).
9+
- [by using the `ddev-platformsh` and `ddev-ibexa-cloud` add-ons](#with-ibexa-cloud-add-ons)
10+
- [like other existing project, without these add-ons](#without-ibexa-cloud-add-ons).
1111

1212
!!! note
1313

1414
The following examples use [[[= product_name_cloud =]] CLI (`ibexa_cloud`)](https://cli.ibexa.co/).
1515

16-
## With the `ddev-platformsh` add-on
16+
## With Ibexa Cloud add-ons
1717

18-
To configure the [`ddev/ddev-platformsh` add-on](https://github.com/ddev/ddev-platformsh), you need a [Platform.sh API Token](https://docs.platform.sh/administration/cli/api-tokens.html).
18+
To configure [`ddev/ddev-platformsh` add-on](https://github.com/ddev/ddev-platformsh) and [`ddev/ddev-ibexa-cloud` add-on](https://github.com/ddev/ddev-ibexa-cloud), you need a [Platform.sh API Token](https://docs.platform.sh/administration/cli/api-tokens.html).
1919

2020
The `ddev/ddev-platformsh` add-on configures the document root, the PHP version, the database, and the cache pool according to the [[= product_name_cloud =]] configuration.
2121
About the search engine, the add-on can configure Elasticsearch but can't configure Solr.
2222
If you use Solr on [[= product_name_cloud =]] and want to add it to your DDEV stack, see [Clustering with DDEV and `ibexa/ddev-solr` add-on](clustering_with_ddev.md#solr).
2323

24-
`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.
24+
The `ddev/ddev-ibexa-cloud` add-on integrates the `ibexa_cloud` command inside the container,
25+
and eases the pull of cloud contents into the local installation.
26+
27+
`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.
2528
But the variable must exist for Platform.sh `hooks` scripts to work.
2629
To use an `auth.json` file for this purpose, see [Using `auth.json`](install_with_ddev.md#using-authjson).
2730

28-
You must remove Node.js and NVM installations as they're already included in DDEV.
29-
3031
The following sequence of commands:
3132

32-
1. Downloads the [[= product_name_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](#ibexa-cloud-and-ddev).
33-
(Replace `<project-ID>` with the hash of your own project.
33+
1. Downloads the [[= product_name_cloud =]] project from the default environment "production"
34+
into a new directory (for example `my-ddev-project`), using the [`ibexa_cloud` command](https://cli.ibexa.co/).
35+
(Replace `<project-ID>` with the hash of your own project.
3436
See [`ibexa_cloud help get`](https://docs.platform.sh/administration/cli.html#3-use) for options like selecting another environment).
3537
1. Configures a new DDEV project.
38+
1. Configures the `ddev/ddev-ibexa-cloud` add-on with `<project-ID>`, environment name (for example, `production`),
39+
and application name (for example, `app` from `name: app` line in `.platform.app.yaml` file).
40+
1. Configures `ibexa_cloud` command token. See [Create an API token](https://docs.platform.sh/administration/cli/api-tokens.html#2-create-an-api-token) for more information.
3641
1. Ignores `.ddev/` directory from Git.
37-
(Some DDEV config could be committed like in [this documentation](https://ddev.readthedocs.io/en/latest/users/extend/customization-extendibility/#extending-configyaml-with-custom-configyaml-files).)
42+
(Some DDEV config could be committed like in [this documentation](https://ddev.readthedocs.io/en/latest/users/extend/customization-extendibility/#extending-configyaml-with-custom-configyaml-files).)
3843
1. Sets Composer authentication by using an already existing `auth.json` file.
39-
1. Creates a `public/var` directory if it doesn't exist, to allow the creation of `public/var/.platform.installed` by Platform.sh hook script.
4044
1. Installs the `ddev/ddev-platformsh` add-on which prompts for the Platform.sh API token, project ID and environment name.
41-
1. Comments out the Node.js and NVM installations from the hooks copied in `.ddev/config.platformsh.yaml`.
42-
(In this file, you may have to discard other specific features like New Relic.)
4345
1. Changes `maxmemory-policy` from default `allkeys-lfu` to a [value accepted by the `RedisTagAwareAdapter`](https://github.com/symfony/cache/blob/5.4/Adapter/RedisTagAwareAdapter.php#L95).
46+
(Check `.ddev/config.platformsh.yaml` and adapt if needed. For example, you may have to comment out New Relic.)
47+
1. Installs the `ddev/ddev-ibexa-cloud` add-on.
4448
1. Starts the project.
45-
1. Gets the content from Platform.sh, both database and binary files by using `ddev pull platform` feature from the add-on.
46-
1. Restarts the project.
49+
1. Gets the content from [[= product_name_cloud =]], both database and binary files by using `ddev pull ibexa-cloud` feature from the add-on.
4750
1. Displays information about the project services.
4851
1. Opens the project in a browser.
4952

5053
```bash
5154
ibexa_cloud project:get <project-ID> my-ddev-project && cd my-ddev-project
52-
ddev config --project-type=php --web-environment-add COMPOSER_AUTH=''
55+
ddev config --project-type=php --php-version 8.1 --web-environment-add COMPOSER_AUTH='',DATABASE_URL=mysql://db:db@db:3306/db
56+
ddev config --web-environment-add IBEXA_PROJECT=<project-ID>,IBEXA_ENVIRONMENT=production,IBEXA_APP=app
57+
ddev config --web-environment-add IBEXA_CLI_TOKEN=<api-token>
5358
echo '.ddev/' >> .gitignore
5459
mkdir -p .ddev/homeadditions/.composer && cp <path-to-an>/auth.json .ddev/homeadditions/.composer
55-
if [ ! -d public/var ]; then mkdir public/var; fi
56-
ddev get ddev/ddev-platformsh
57-
sed -i -E "s/( +)(.*nvm (install|use).*)/\1#\2/" .ddev/config.platformsh.yaml
60+
ddev add-on get ddev/ddev-platformsh
5861
sed -i 's/maxmemory-policy allkeys-lfu/maxmemory-policy volatile-lfu/' .ddev/redis/redis.conf
62+
ddev add-on get ddev/ddev-ibexa-cloud
5963
ddev start
60-
ddev pull platform -y
61-
ddev restart
64+
ddev pull ibexa-cloud -y
6265
ddev describe
6366
ddev launch
6467
```
@@ -67,13 +70,13 @@ ddev launch
6770

6871
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`.
6972

70-
## Without the Platform.sh add-on
73+
## Without Ibexa Cloud add-ons
7174

7275
The following example adapts the [manual method to run an already existing project](install_with_ddev.md#run-an-already-existing-project) to the Platform.sh case:
7376

7477
The following sequence of commands:
7578

76-
1. Downloads the [[= product_name_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](#ibexa-cloud-and-ddev).
79+
1. Downloads the [[= product_name_cloud =]] Platform.sh project from the default environment "production" into a new directory, using the [[[= product_name_cloud =]] CLI](https://cli.ibexa.co/).
7780
(Replace `<project-ID>` with the hash of your own project. See [`ibexa_cloud help get`](https://docs.platform.sh/administration/cli.html#3-use) for options like selecting another environment).
7881
1. Configures a new DDEV project.
7982
1. Ignores `.ddev/` directory from Git.
@@ -94,7 +97,7 @@ echo '.ddev/' >> .gitignore
9497
ddev start
9598
ddev composer config --global http-basic.updates.ibexa.co <installation-key> <token-password>
9699
ibexa_cloud db:dump --gzip --file=production.sql.gz
97-
ddev import-db --src=production.sql.gz && rm production.sql.gz
100+
ddev import-db --file=production.sql.gz && rm production.sql.gz
98101
ibexa_cloud mount:download --mount public/var --target public/var
99102
ddev composer install
100103
ddev describe

docs/ibexa_cloud/install_on_ibexa_cloud.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,19 @@ You can set this token as an environment variable.
7070
When you do, make sure the **Visible during runtime** box in Platform.sh configuration is unchecked.
7171
This ensures that the token isn't exposed.
7272

73-
![Setting token to be invisible during runtime](psh_addvariable.png)
73+
### Composer authentication using the web console
74+
75+
In **Settings** (top right gear icon) -> **Project Settings** -> **Variables** -> **+ Create variable**
76+
77+
![Setting token to be invisible during runtime](ibexa_cloud-composer_auth.png)
78+
79+
### Composer authentication using the CLI command
80+
81+
```bash
82+
ibexa_cloud variable:create --level project --name env:COMPOSER_AUTH \
83+
--json true --visible-runtime false --sensitive true --visible-build true \
84+
--value '{"http-basic": {"updates.ibexa.co": {"username": "<installation-key>", "password": "<token-password>"}}}'
85+
```
7486

7587
## 4. Push the project
7688

0 commit comments

Comments
 (0)