While developing or maintaining a Drupal application (glossary term, activate to view definition), you might need to add Drupal contributed modules. If your application is hosted on Cloud Platform, the module directories are part of the code repository, which is not directly writable. Therefore, you cannot add a module by using the Update Manager, drush dl, or SFTP. However, you can commit your changes using a version control system (Git).
There are several different approaches you can take. This topic describes two of them:
To add a module to your local code base, and then commit it:
Create a feature branch to test the module. In this example, we’ll assume that we’re installing the Foo module, so we’ll call the feature branch foo.
git checkout -b fooChange directory into the modules directory of your Drupal version:
| Drupal version | Module directory location |
|---|---|
| Drupal 7 | /sites/all/modules or /sites/all/modules/contrib |
Using Live Development mode, you can temporarily make the docroot of your Development environment writable, so you can add modules or make other changes.
Here are the steps for installing a module on a Cloud Platform environment using Live Development, and then committing it. It’s important that you commit your changes to your Cloud Platform code repository before you disable Live Development. Otherwise, the new module won’t be part of your application’s code base. If your application’s database thinks the new module is enabled, but it can’t be found, this can cause havoc.
/admin/modules page./admin/modules page, click Install new module and use the Update Manager to install the module./mnt/gfs/[sitename].[env]/livedev.drush dlThere are several different approaches you can take. This topic describes two of them:
To add a module to your local code base, and then commit it:
Create a feature branch to test the module. In this example, we’ll assume that we’re installing the Foo module, so we’ll call the feature branch foo.
git checkout -b fooChange directory into the modules directory of your Drupal version:
| Drupal version | Module directory location |
|---|---|
| Drupal 7 | /sites/all/modules or /sites/all/modules/contrib |
| Current Drupal version | /modules or /modules/contrib |
Download and add the contributed module to the modules directory in the feature branch. For example:
curl http://ftp.drupal.org/files/projects/foo.tar.gz | tar fzUsing Live Development mode, you can temporarily make the docroot of your Development environment writable, so you can add modules or make other changes.
Here are the steps for installing a module on a Cloud Platform environment using Live Development, and then committing it. It’s important that you commit your changes to your Cloud Platform code repository before you disable Live Development. Otherwise, the new module won’t be part of your application’s code base. If your application’s database thinks the new module is enabled, but it can’t be found, this can cause havoc.
/admin/modules page./admin/modules page, click Install new module and use the Update Manager to install the module./mnt/gfs/[sitename].[env]/livedev.| Current Drupal version |
/modules or /modules/contrib |
Download and add the contributed module to the modules directory in the feature branch. For example:
curl http://ftp.drupal.org/files/projects/foo.tar.gz | tar fzIf this content did not answer your questions, try searching or contacting our support team for further assistance.
If this content did not answer your questions, try searching or contacting our support team for further assistance.