Upstreams on Pantheon
Manage Upstream Dependencies
Learn how to manage dependencies for your upstream.
This section provides information on how to manage dependencies for an existing upstream.
Add Dependencies to Your Upstream
-
Clone the Git repository for your upstream.
-
Require the upstream management package if you have not already:
-
Run the
composer upstream:requirecommand for each dependency: -
Commit and push your changes to your
composer.jsonfile. Remember to not commit thecomposer.lockfile.The
composer.lockfile should not be added to your.gitignorefile, since it must still be committed for individual sites created from your upstream. Instead, run the following command to prevent yourself from accidentally committing it while working directly in the upstream repository:
Update Dependencies in Your Upstream
You may need to pin specific versions of your dependencies in your upstream. This is normally done with the composer.lock file. However, including the composer.lock file in the root of the upstream causes merge conflicts with your downstream sites. You can use the upstream:update-dependencies composer command to solve this problem.
-
Run
composer update-upstream-dependenciesin your upstream repository. Theupstream:update-dependenciescommand will:-
Create or update a
upstream-configuration/composer.lockfile. -
Create or update a
upstream-configuration/locked/composer.jsonfile with all packages fromcomposer.lockand their pinned versions. -
Update the top-level
composer.jsonrepositories section forupstream-configurationto useupstream-configuration/lockedinstead of justupstream-configuration(if not done previously).
-
-
Commit the changes and begin using the pinned versions in your downstream sites. This allows you to make sure that you use specific versions for the packages in your upstream.