Setting up CircleCI + WPengine CI/CD
Setting up a project in CirceCI and WPEngine requires a pair of SSH keys (key pair). If the link on the 1Password site for obtaining SSH keys is not available to you, please contact Valera Vilks (valera@dreamersoday.co).
📃 CircleCI (Setting Variables)
How to set variables?
- Go to "Project Setting"->"Environment Variables" page.
- Click "Add Environment Variable".
- Set "name" and "value" variable.
Address for Git Push
- Name = "GIT_PUSH_URL"
- Value = "" (Example: "git@git.wpengine.com:production/dodboilerwpv1.git"). You can find this value in the GIT PUSH in WPEngine section.
🚀 CircleCI (deployments)
You need to add your private key to CircleCI to access WPEngine and BitBucket. To do this, take the following steps:
- Follow the link https://app.circleci.com/projects/
- Select "DODdevteam" (or other account in which the project is located)
- On the projects page, select the desired project with which you are working. This is the name of the repository in BitBucket.
- Click on "Project Setting"
- Go to "SSH Keys" section
- In the "Additional SSH Keys" section, click on the "Add SSH key" button
- Follow the link to get the private key (Link)
- Copy the PRIVATE key (It is important to copy the private key)
- In the "Hostname" field, enter "bitbucket.org"
- In the "Private Key" field, paste the previously copied private key
- Click on the "Add SSH key" button. At this point, the dialog box will close and one entry will be added in the "Additional SSH Keys" section.
- Now you need to repeat the last few steps one more time to add the private key for WPEngine.
- In the "Additional SSH Keys" section, click on the "Add SSH key" button
- In the "Hostname" field, enter "git.wpengine.com"
- In the "Private Key" field, paste the private key you copied earlier.
- Click on the "Add SSH key" button. At this point, the dialog box will close and another entry will be added in the "Additional SSH Keys" section.
This completes the CircleCI setup.
☁️ WPEngine (hosting)
WPEngine must contain a public key in order to connect to CircleCI.
To add a public key to WPEngine follow these steps:
- Go to the site page in the WPEngine admin panel
- Go to "Git Push" section
- In the "Developer name" field, enter "CircleCI"
- Follow the link to the 1password service and copy the public key Link (It is important to copy the public key)
- In the "SSH public key" field, paste the public key
- Click "Add Developer"
The public key has been added to WPEngine. It is important to wait 10 minutes for this key to work.
🪣 BitBucket (git repositories)
This set-up is needed just once for all projects.
This set uses "composer" to install plugins. Some plugins are stored in private repositories on BitBucket. The public key will be added once for all starter kit and subsequent projects, it is not necessary to add this public key each time.
Instructions on how to add a public key for private plugins:
- Go to the private plugins project settings page (Link)
- Click "Add key"
- In the "Label" field, add the value "CircleCI"
- Follow the link to the 1password service and copy the public key Link (It is important to copy the public key)
- Enter the public key in the "Key" field.
- Click "Add ssh key"
You have added a public key for BitBucket repositories with private plugins