Upsun Fixed (Platform.sh) Integration¶
DDEV provides integration with the Upsun “Fixed” Website Management Platform (formerly Platform.sh), which allows Upsun Fixed users to quickly download and provision a project from Upsun in a local DDEV-managed environment.
Tip
Consider using ddev add-on get ddev/ddev-upsun
(platformsh/ddev-upsun) for more complete Upsun Fixed integration.
DDEV’s Upsun Fixed integration pulls databases and files from an existing Upsun/Platform.sh-style site/environment into your local system so you can develop locally.
Upsun Fixed (Platform.sh) Global Configuration¶
You need to obtain and configure an API token first. This is only needed once.
- Login to the Upsun Dashboard and go to Account → API Tokens. Create an API token DDEV can use.
-
Add the API token to the
web_environment
section in your global DDEV configuration at~/.ddev/global_config.yaml
:You can also do this with:
What if I have more than one API token?
To use multiple API tokens for different projects, add them to your per-project configuration using the
.ddev/config.local.yaml
file instead. This file is gitignored by default.
Upsun/Platform.sh Per-Project Configuration¶
- Check out the site and configure it with
ddev config
. You’ll want to useddev start
and make sure the basic functionality is working. -
Add
PLATFORM_PROJECT
andPLATFORM_ENVIRONMENT
variables to your project.-
Either in
.ddev/config.yaml
or a.ddev/config.*.yaml
file: -
Or with a command from your terminal:
-
-
Run
ddev restart
. - Run
ddev pull platform
. After you agree to the prompt, the current upstream databases and files will be downloaded. - Optionally use
ddev push platform
to push local files and database to Upsun. Theddev push
command can potentially damage your production site, so use it against a known environment and not against your production site..
Managing Multiple Apps¶
If your environment contains more than one app, add PLATFORM_APP
variable to your project:
-
Either in
.ddev/config.yaml
or a.ddev/config.*.yaml
file: -
Or with a command from your terminal:
Managing Multiple Databases¶
If your project has only one database, it will automatically be pulled into and pushed from DDEV’s 'db'
database.
If your project has multiple databases, they’ll all be pulled into DDEV with their respective remote names. You can optionally designate a primary to use DDEV’s default 'db'
database, which may be useful in some cases—particularly if you’ve been using the default solo-database behavior and happened to add another one to your project.
You can designate the primary database using the PLATFORM_PRIMARY_RELATIONSHIP
environment variable:
You can also do the same thing by running ddev pull platform
and using the --environment
flag:
Usage¶
ddev pull platform
will connect to Upsun to download database and files. To skip downloading and importing either file or database assets, use the--skip-files
and--skip-db
flags.- If you need to change the
platform.yaml
recipe, you can change it or copy it to suit your needs, but remember to remove the#ddev-generated
line from the top of the file.