You will need git, composer, php
~/.ssh/id_rsaas is. If the command says the key already exists, you can either overwrite it, or continue to the next step with your existing key.
The build process on Pantheon is done with Composer, the build prioritizes the composer.json and composer.lock file in the root of the repo, and builds out based on those two files.
After checking out a site repo from the Pantheon dashboard under the 'connection info' button, composer can be used to to install and uninstall modules via the command line from with the site repo directory, some useful commands are below:
composer require drupal/admin_toolbar
drupal/admin_toolbartells composer what repository the package is in, in this case drupal, and what exactly to install, in this example admin_toolbar
composer --ignore-platform-reqs -W require drupal/admin_toolbar:^3
composer remove drupal/admin_toolbar
Adding libraries is possible via composer, this allows composer to download and install the library files, freeing you from having to manage them. Adding libraries to the composer.json is a bit more complicated then adding a module, detailed documentation can be found on the Drupal.org page.
To update all modules in your composer file to get all new versions for updates and security releases, you can run the update command. You should also run the update command once all needed additions and removals have been done via composer, to ensure all your changes work correctly and have been picked up. The update command should be run via:
This command will run the composer.json file, and build out the composer.lock file, downloading and installing all specific modules and dependencies that are listed as needed for the site. If you do not wish to install all the files locally, you can run composer update --no-install. Any updated versions since you last ran this will also be grabbed.
After installing and/or removing all modules with composer, and running composer update, you are now ready to commit your changes to the site repo and push them back to the Pantheon server to be build. From your git repo on the command line, or from your git GUI, you should see two files that have been changed, composer.json and composer.lock (if you see other files being changed, please see the pitfalls section below).
git add file_name" or "
git add ."
git commit -m "your message here", and give the commit a message describing what changes were done between the "".
Once you push your changes, Pantheon will run the composer.json on their servers, and the changes will be deployed to the dev version of your site for review.
Once the changes have been pushed to the main branch and built on the Pantheon servers, they will appear on within the dev site environment. The dev site should be then tested to make sure the changes work as expected, and everything is still correct with the site. Once this testing is completed, the changes need to be pushed to the test environment, and finally to the live environment so that the public facing site receives the updates. To deploy the updates, click on the 'Test' tab on the site Pantheon dashboard, the first pane there should be the deploy section. You will see a list of changes that will be deployed, and a box for deploy messages. Write a message as desired, and click the 'deploy code' button. Once the code has been deployed on the test instance, repeat the same process for the live environment via the "Live" tab.
composer --ignore-platform-reqs -W require drupal/admin_toolbar" or "
composer remove drupal/admin_toolbar" as needed to install or remove modules
composer update" to build out the local site composer files
The Pantheon build process can balk anywhere it encounters files that it 'expects' to be from Composer being committed in the git repo itself. Changing and committing files in directories where Composer puts files, especially force commits with git -f force, can cause problems. It is best to avoid using git -f force as a general rule.
If you have custom code for themes or modules, they should be added to the directories below:
Pantheon also does not change its build restrictions based on changes to the .gitignore file. Removing lines from the .gitignore and committing files in those now tracked directories can still lead to the Pantheon build process issues. We recommand avoiding making changes to the .gitignore file.