In this section we'll use the Terminus Build Tools Plugin to create a new Pantheon Site, a corresponding GitHub repository, and configure CircleCI to run tests.
Create a new project (replace
pantheon-d8-composer-project with the name of your new site):
terminus build:project:create d8 pantheon-d8-composer-project
Pantheon also maintains Composer based examples for WordPress and Drupal 7 that are currently in alpha, requiring
--stability=alpha in the command line options. While this guide demonstrates Drupal 8, the same workflow can be achieved on all frameworks.
Provide additional information as prompted, such as Organization (if any), and tokens for GitHub and CircleCI access:
This process will create a secure keypair, with the public key going to Pantheon and the private key stored in CircleCI. If you remove either key, you will need to generate a new pair manually to fix the build process.
As packages pulled by Composer are updated (along with their dependencies), version compatibility issues can pop up. Sometimes you may need to manually alter the version constraints on a given package within the
require-dev section of
composer.json in order to update packages. See the updating dependencies section of Composer's documentation for more information.
As a first troubleshooting step, try running
composer update to bring
composer.lock up to date with the latest available packages (as constrained by the version requirements in
If you encounter an issue such as:
The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Operation timed out Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Operation timed out https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date [Composer\Downloader\TransportException] Content-Length mismatch create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>] [error] Command `composer create-project --working-dir=/private/var/folders/lp/7_1gh83s5mn9lwfjvqqlf1lm0000gn/T/local-sitevPumRP pantheon-systems/example-wordpress-composer pantheon-wp-composer-project -n --stability dev` failed with exit code 1
This indicates a network level issue. We recommend contacting your Internet Service Provider (ISP) for support. One way to reduce connection woes is to use a non-standard channel with less activity/noise on wireless modems.
Check the output for the recommended fix. For example, PHP 7.0 is required for WordPress. Once you have resolved the issues as suggested by Composer try the command again.
The following error occurs when running
terminus build:project-create before authenticating your session with Terminus:
BuildToolsCommand.php line 166: The site name exampleuniquesitename is already taken on Pantheon.
To resolve, generate a Machine Token, then authenticate Terminus and try the build command again:
terminus auth:login --machine-token=<machine-token>
Pantheon's composer based example repositories are maintained and supported on GitHub. After browsing existing issues, report errors in the appropriate repository's issue queue:
Once your site is ready, the URL to your project page will be printed to your terminal window. Copy this address and paste it into a browser to visit your new project on GitHub:
The badges on your project page provide quick access to the different components used to manage your site:
If you click on the CircleCI badge, you can watch your project's initial test run. Once your tests successfully complete, the orange CircleCI "no builds" badge will become a green "passing" badge: