PHPackages                             carlalexander/bedrock-pantheon-circleci - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. carlalexander/bedrock-pantheon-circleci

ActiveProject[Framework](/categories/framework)

carlalexander/bedrock-pantheon-circleci
=======================================

WordPress project template for using Bedrock with Pantheon and CircleCI

1.13.0(6y ago)8262MITPHPPHP &gt;=7.1

Since Feb 18Pushed 6y ago2 watchersCompare

[ Source](https://github.com/carlalexander/bedrock-pantheon-circleci)[ Packagist](https://packagist.org/packages/carlalexander/bedrock-pantheon-circleci)[ Docs](https://roots.io/bedrock/)[ RSS](/packages/carlalexander-bedrock-pantheon-circleci/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (8)Versions (2)Used By (0)

Bedrock template project for Pantheon (CircleCI)
================================================

[](#bedrock-template-project-for-pantheon-circleci)

This is a project template for using [bedrock](https://roots.io/bedrock) with [Pantheon](https://pantheon.io). This project shows you how to use bedrock on Pantheon with [CircleCI](https://circleci.com) handling continuous deployment.

Creating a project
------------------

[](#creating-a-project)

To create a new project, just use the following command:

```
$ composer create-project carlalexander/bedrock-pantheon-circleci
```

You'll then need to update the environment variables in your project's `.env`file. You can read about all the Bedrock environment variables in the [Bedrock documentation](https://roots.io/bedrock/docs/installing-bedrock).

Configuration
-------------

[](#configuration)

By itself, the project template only has the code and configuration files required to work on the Pantheon and CircleCI platforms. Both platforms require some additional configuration for the continuous deployment workflow to work.

### Configuring SSH

[](#configuring-ssh)

The first thing that you'll need to do is to grant CircleCI SSH access to your account. To do that, you should create a special SSH key just for CircleCI. Start by running this command in your project directory:

```
$ ssh-keygen -m pem -C "circleci"
```

This command will create two files, `id_rsa` and `id_rsa.pub`, in your project directory. You'll use these two files to configure CircleCI and Pantheon.

**Important:** Do not commit the `id_rsa` and `id_rsa.pub` files into your project.

#### CircleCI

[](#circleci)

First, we're going to configure CircleCI. In the CircleCI application, go to your bedrock project’s settings by clicking the gear icon next to your project.

[![Project settings](https://camo.githubusercontent.com/2fbb3cf03add762404b9641d074bddfea241f00cf1fff08fd2d894db6afb8dd5/68747470733a2f2f642e70722f692f427a464643362b)](https://camo.githubusercontent.com/2fbb3cf03add762404b9641d074bddfea241f00cf1fff08fd2d894db6afb8dd5/68747470733a2f2f642e70722f692f427a464643362b)

There, you want to go to the **SSH Permissions** screen. You then want to click on the **Add SSH Key** button. This will open a modal window where you can enter the SSH key that you want to add to your CircleCI project. The modal has two fields: **Hostname** and **Private Key**.

[![SSH key modal window](https://camo.githubusercontent.com/da7bdfa35fe56249c5498cdae71a3ef1379ab4e3cd5e5fa1475e73ebbcca6917/68747470733a2f2f642e70722f692f756c6e6555362b)](https://camo.githubusercontent.com/da7bdfa35fe56249c5498cdae71a3ef1379ab4e3cd5e5fa1475e73ebbcca6917/68747470733a2f2f642e70722f692f756c6e6555362b)

For the **Hostname**, you want enter `drush.in`. This will limit the SSH key use to only Pantheon servers. If you leave it empty, the SSH key will be used for all SSH connections which we don't want.

The **Private Key** is the content of the `id_rsa` file that we created with the `ssh-keygen` command. The content of the `id_rsa` file will always start with: `-----BEGIN RSA PRIVATE KEY-----`. Once you've filled the two form fields, you want to click on **Add SSH Key** button to add the SSH key.

[![SSH keys screen](https://camo.githubusercontent.com/980c7a18b8fca54a832136c3c8d44a5d6d045932506b9b936c0ee2b04d6eefd9/68747470733a2f2f642e70722f692f6d767a7861752b)](https://camo.githubusercontent.com/980c7a18b8fca54a832136c3c8d44a5d6d045932506b9b936c0ee2b04d6eefd9/68747470733a2f2f642e70722f692f6d767a7861752b)

You should then see it appear in the list of SSH keys.

#### Pantheon

[](#pantheon)

Next, you need to add the SSH key to your Pantheon account. From the dashboard, you want to go to the account page by clicking the **Account** tab.

[![Account tab](https://camo.githubusercontent.com/81314efcdcd892d4d17f899d5ca26bfc808984cdccf0cf091d704873f7005efb/68747470733a2f2f642e70722f692f5a714f5371682b)](https://camo.githubusercontent.com/81314efcdcd892d4d17f899d5ca26bfc808984cdccf0cf091d704873f7005efb/68747470733a2f2f642e70722f692f5a714f5371682b)

There you want to go to the **SSH Keys** section and fill the **Add an SSH Key**form. For this form, you want to copy the public key instead of the private key. You can find it in the `id_rsa.pub` file.

[![Add an SSH key form](https://camo.githubusercontent.com/98f16dff38ee35d13943c515034c4014f4cd6a3f46e9df8c85c76e45f3f015a0/68747470733a2f2f642e70722f692f55395741596a2b)](https://camo.githubusercontent.com/98f16dff38ee35d13943c515034c4014f4cd6a3f46e9df8c85c76e45f3f015a0/68747470733a2f2f642e70722f692f55395741596a2b)

The beginning of the file will always start with `ssh-rsa`. If you use the `-C "circleci"` option with the `ssh-keygen` command, the file will end with `circleci`. Once you've copied the content of the `id_rsa.pub` file, you want to click on **Add Key**.

[![SSH keys screen](https://camo.githubusercontent.com/123b46c3816ce477ab467918b57322ca374eec76083e259f0c6060744a9adbcc/68747470733a2f2f642e70722f692f4254486666342b)](https://camo.githubusercontent.com/123b46c3816ce477ab467918b57322ca374eec76083e259f0c6060744a9adbcc/68747470733a2f2f642e70722f692f4254486666342b)

You should then see it appear in the list of SSH keys.

### Creating the initial .env file

[](#creating-the-initial-env-file)

Unlike a standard WordPress site, a Bedrock site uses environment variables to manage sensitive credentials. These environment variables can come from different sources. The most important one being `.env` file which Bedrock uses instead of the standard WordPress `wp-config.php` file.

Pantheon won't create the initial `.env` file that your Bedrock site needs. You're going to have to create it yourself and upload it to the Pantheon server. To easiest way to do that is by connecting to your Pantheon server using FTP and creating the `.env` file.

[![Connection Info](https://camo.githubusercontent.com/9865994f5a033f1c8b86c8fe259a629924c93ce51d9e66c63264b0298a180b9c/68747470733a2f2f642e70722f692f526e574c49622b)](https://camo.githubusercontent.com/9865994f5a033f1c8b86c8fe259a629924c93ce51d9e66c63264b0298a180b9c/68747470733a2f2f642e70722f692f526e574c49622b)

To connect to your Pantheon site using FTP, go to your site admin panel in the Pantheon dashboard. There, you'll see a **Connection Info** button to the right as shown above. This will open a menu with all the credentials used to connect to your Pantheon site.

[![SFTP credentials](https://camo.githubusercontent.com/bd980602cee76d4f94542fed8ab4593a1ad36c4cf2438609fd30630fa49cc844/68747470733a2f2f642e70722f692f3173626155612b)](https://camo.githubusercontent.com/bd980602cee76d4f94542fed8ab4593a1ad36c4cf2438609fd30630fa49cc844/68747470733a2f2f642e70722f692f3173626155612b)

You'll find the SFTP credentials at the bottom. Use these SFTP credentials to connect to your Pantheon site. Once connected, you want to go to the `files`directory and create the `private` directory. You want to create your `.env`file in the `private` directory that you just created with the following:

```
WP_ENV=development
WP_SITEURL=${WP_HOME}/wp

# Generate your keys here: https://roots.io/salts.html
AUTH_KEY='generateme'
SECURE_AUTH_KEY='generateme'
LOGGED_IN_KEY='generateme'
NONCE_KEY='generateme'
AUTH_SALT='generateme'
SECURE_AUTH_SALT='generateme'
LOGGED_IN_SALT='generateme'
NONCE_SALT='generateme'

```

It's important that you replace all the keys with new ones that were generated [here](https://roots.io/salts.html). You'll also notice that this is a more trimmed down `.env` file than what you're used to see with Bedrock. That's because Pantheon supplies a lot of the environment variables that we'd store in the `.env` file normally.

### CircleCI environment variables

[](#circleci-environment-variables)

For the CircleCI Pantheon deployment script to work, we need to configure some project specific environment variables. To do that, you're going to have to go back to your project's setting in CircleCI. You can access them by clicking on the gear icon.

[![Environment Variables screen](https://camo.githubusercontent.com/7064088e8a1a03e01a3aa8d9f01ad7c46dca9a3a337570369880eda35b883ab6/68747470733a2f2f642e70722f692f4f394c43746e2b)](https://camo.githubusercontent.com/7064088e8a1a03e01a3aa8d9f01ad7c46dca9a3a337570369880eda35b883ab6/68747470733a2f2f642e70722f692f4f394c43746e2b)

There, you want to navigate to the **Environment Variables** screen. Next, you'll need to add specific environment variables. The following sections will explain how to get the value for each environment variable.

#### TERMINUS\_SITE

[](#terminus_site)

The `TERMINUS_SITE` environment variable is the name of the site that we're deploying on the Pantheon platform. The easiest way to get that value is by going to your site on the Pantheon. In the admin panel, you want to click to visit the development version of the site.

[![Development site button](https://camo.githubusercontent.com/c2f0767f1815d61af36e4fbc59f30210470eb0446252bf17d448dc8a878be43e/68747470733a2f2f642e70722f692f727a4e514e592b)](https://camo.githubusercontent.com/c2f0767f1815d61af36e4fbc59f30210470eb0446252bf17d448dc8a878be43e/68747470733a2f2f642e70722f692f727a4e514e592b)

The URL for the development version of the site should look something like `http://dev-xxxxxxx.pantheonsite.io/`. The `xxxxxxx` is the name of site on the Pantheon platform. You need to use that as the value of your `TERMINUS_SITE`environment variable.

[![Adding TERMINUS_SITE](https://camo.githubusercontent.com/49651a78f4794faf081adc21827e9da6c3a564cbf5668bd384abc2b70cb47652/68747470733a2f2f642e70722f692f4846613546382b)](https://camo.githubusercontent.com/49651a78f4794faf081adc21827e9da6c3a564cbf5668bd384abc2b70cb47652/68747470733a2f2f642e70722f692f4846613546382b)

#### TERMINUS\_TOKEN

[](#terminus_token)

The `TERMINUS_TOKEN` environment variable is the token used by terminus to authenticate with the Pantheon platform. You create it by going to the **Machine Tokens** section in the **Account** tab of the Pantheon dashboard. You then want to click on **Create token** to create your machine token.

[![Create new token page](https://camo.githubusercontent.com/b81e842c34bd38f9225db6a9342a0d30d71e2c30bd79a5e53bed66f3c2631fff/68747470733a2f2f642e70722f692f6e77615775782b)](https://camo.githubusercontent.com/b81e842c34bd38f9225db6a9342a0d30d71e2c30bd79a5e53bed66f3c2631fff/68747470733a2f2f642e70722f692f6e77615775782b)

You'll need to give a name to identify your machine token. Once that's done, you want to click on **Generate token**. This will generate the token and bring a modal.

[![Generate token modal](https://camo.githubusercontent.com/246d723c9ffec5a7989be36d6912f46d2cf275cd77173564a8b6d78ecfe7bac2/68747470733a2f2f642e70722f692f5673626b70412b)](https://camo.githubusercontent.com/246d723c9ffec5a7989be36d6912f46d2cf275cd77173564a8b6d78ecfe7bac2/68747470733a2f2f642e70722f692f5673626b70412b)

Pantheon will only show you the machine token once. You can save it somewhere if you need to. Otherwise, just head over to your project's settings in CircleCI and add the machine token as the value of your `TERMINUS_TOKEN` environment variable.

[![Adding TERMINUS_TOKEN](https://camo.githubusercontent.com/6184247632d7ceb08aa7843af63ee791b4f49c1db4e250ec91e527674e2fe6e0/68747470733a2f2f642e70722f692f4d68713862382b)](https://camo.githubusercontent.com/6184247632d7ceb08aa7843af63ee791b4f49c1db4e250ec91e527674e2fe6e0/68747470733a2f2f642e70722f692f4d68713862382b)

#### GITHUB\_TOKEN (optional)

[](#github_token-optional)

The deployment script will create [multidev](https://pantheon.io/docs/multidev/)environments whenever CircleCI is running for a pull request. These multidev environments won't get cleaned up once the pull request gets merged. For that, you need to allow terminus to connect to your GitHub account.

To do that, you need to add the `GITHUB_TOKEN` environment variable. The value of the `GITHUB_TOKEN` environment variable comes from creating a personal access token on GitHub. You can find a guide explaining how to create one [here](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line).

[![GitHub personal token](https://camo.githubusercontent.com/d05a6bbe29fafe47e7c86af572c69d7cdb78445953fc8ff3415efdd4041b8871/68747470733a2f2f642e70722f692f72576b6d4c482b)](https://camo.githubusercontent.com/d05a6bbe29fafe47e7c86af572c69d7cdb78445953fc8ff3415efdd4041b8871/68747470733a2f2f642e70722f692f72576b6d4c482b)

Once created, GitHub will only show your personal token once. You can save it somewhere if you want. Otherwise, just head over to your project's settings in CircleCI and add the machine token as the value of your `GITHUB_TOKEN`environment variable.

[![Adding GITHUB_TOKEN](https://camo.githubusercontent.com/375b22beae3d9bf7d1a7c6fc366cc7d35733b13cc69df804e07878172c5e1287/68747470733a2f2f642e70722f692f7566375745672b)](https://camo.githubusercontent.com/375b22beae3d9bf7d1a7c6fc366cc7d35733b13cc69df804e07878172c5e1287/68747470733a2f2f642e70722f692f7566375745672b)

Acknowledgements
----------------

[](#acknowledgements)

Thanks to the [Roots team](https://roots.io) for creating and maintaining the Bedrock project. Also thanks to [Andrew Taylor](http://www.ataylor.me/) for his [repo](https://github.com/ataylorme/Advanced-WordPress-on-Pantheon) showing how to have advanced deployment workflow with WordPress and Pantheon.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2276d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9dc50dba9cc5e4bf097f44026034daa66e2ed552549ba363304ff22914f4c0d1?d=identicon)[carlalexander](/maintainers/carlalexander)

---

Top Contributors

[![carlalexander](https://avatars.githubusercontent.com/u/654684?v=4)](https://github.com/carlalexander "carlalexander (28 commits)")

---

Tags

composerwordpresswprootsbedrockwp-config

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/carlalexander-bedrock-pantheon-circleci/health.svg)

```
[![Health](https://phpackages.com/badges/carlalexander-bedrock-pantheon-circleci/health.svg)](https://phpackages.com/packages/carlalexander-bedrock-pantheon-circleci)
```

###  Alternatives

[roots/bedrock

WordPress boilerplate with Composer, easier configuration, and an improved folder structure

6.5k441.8k2](/packages/roots-bedrock)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
