Integrated Composer lets you deploy your site on Pantheon with one-click updates for both upstream commits and Composer dependencies, while still receiving upstream updates.
Create a new site with Integrated Composer as part of Pantheon's Limited Availability release. New sites created through Pantheon's Limited Availability program are production-ready.
Please note the Limited Availability program does not include a path to upgrade from previous Drupal versions to Drupal 9. Upgrade instructions for existing Drupal 8 Composer-enabled sites will be available when Integrated Composer moves into General Availability.
Use this link to create a new Drupal 9 Integrated Composer site from the Upstream: https://dashboard.pantheon.io/sites/create?upstream_id=e96c6794-77fe-4931-9a20-48a2fe1a3789. On the Create Your Pantheon Site page:
Enter a name for the site.
Choose an Organization if applicable.
Choose a region for the site. Click Continue.
After you click Continue, it will take several minutes for the platform to set everything up.
In the Dev tab on the Dashboard, set the site's Development Mode to SFTP.
Still in the Dev tab, click Visit Development Site and follow the prompts to complete the CMS installation.
Return to the Dev tab, set the site's Development Mode to Git, and clone the site locally.
In your local terminal, from the project root directory, run
Add a new Custom Upstream on the Pantheon dashboard.
Create a new WordPress site from the Upstream.
- Do not customize the upstream yet.
In the Dev environment, click Visit Development Site and follow the prompts to complete the CMS installation.
Clone the site locally and run
The upstream has the following directory structure:
core/ ├─ .gitignore ├─ composer.json └─ pantheon.upstream.yml ├─ README.md └─ upstream-configuration/ └─ composer.json
.gitignore: Prevents build artifacts generated by Composer from being committed to the upstream or site code repositories.
composer.json: The two different
composer.jsonfiles allow customization of individual sites without inherent merge conflicts and enable one-click updates.
- Root-level: Site-level customizations.
upstream-config/composer.json: Composer automatically updates
composer.jsonwith customizations for the upstream. Avoid manually modifying this file.
build_step: truedirective in
pantheon.upstream.ymlenables the build step. This name is temporary and will change.
When a site is created, Pantheon runs
composer install, generates a
composer.lock file and commits it back to the site’s code repository.
Build artifacts are stored in a Git tag like
$BRANCHNAME is the name of the environment or Multidev feature branch).
Start with the local clone of the Upstream repository you created above.
Change into the
composer require drupal/pkg-name --no-update
--no-updatetells Composer to disable automatic updates of the dependency. This makes Composer faster when adding dependencies to the Upstream as shown here.
--no-updateshould not be included when adding dependencies to a site.
Set or increment the current configuration version:
If this is your first time setting the config version:
Confirm the version:
composer config version 1.0.0
Increment the config version number when you update dependencies. If you don't increment the version number, Composer will ignore updated dependencies. Replace
1.0.1in this example with another number:
composer config version 1.0.1
Commit and push.
Navigate to Code in the Dev tab of the site's Dashboard.
Click Check Now. If updates are available, click Apply Updates.
Clone the Git repository from the Pantheon site's dashboard.
Add a new dependency locally:
composer require drupal/pkg-name
- Pantheon will run Composer, generate build artifacts, and deploy it to your Dev or Multidev environment.
composer remove drupal/pkg-name
Pantheon supports the version of Composer integrated into the Pantheon platform and available for use with all Drupal 8+ and WordPress sites. Pantheon’s support for Composer is limited to the application level, and any Composer scripts or modifications made with a Composer script are outside the Pantheon Scope of Support.
All Composer commands are available through the Commit Log in the Site Dashboard's development environment.
Composer build logs are only available after the task or action completes (or fails).
git diff to view changes, excluding composer.lock
git diff d94d1a1179 -- . ':(exclude)composer.lock'
Try composer-lock-diff to see what packages have changed after
Pantheon does not offer support for Composer GUIs or any conflicts that might be cause by one.
Pantheon's devs are working hard to make the Integrated Composer experience on Pantheon better.
Features that are still in development:
- Integrated Composer and Build Tools
- Upgrade an existing site to use Integrated Composer