Terminus Build Tools Plugin development is done through a fork/PR workflow for any outside contributors. There is an automatic test suite which must pass before pull requests are merged. However, the test suite does require some setup for each fork to work. Due to privacy/security considerations, each fork must use its own circle-ci instance as it requires access to GitHub, Pantheon etc.
- Fork this repository (Github account required)
- Login/register with CircleCI.
- In CircleCI UI:
- Create a CI instance for your fork.
- Add environment variables. By default, this would be at:
https://circleci.com/gh/YOURUSERNAME/terminus-build-tools-plugin/edit#env-vars
BITBUCKET_PASS
Bitbucket app password.BITBUCKET_USER
Your Bitbucket username.CIRCLE_TOKEN
A generated CircleCI token.GITHUB_TOKEN
A generated GitHub token - needs at least create/edit/delete repo permissionsGITHUB_USER
Your GitHub username.GIT_EMAIL
The email to use for commits.TERMINUS_ORG
The agency account to use for creating Pantheon sites.TERMINUS_TOKEN
A generated Pantheon/Terminus access token.GITLAB_TOKEN
A generated GitLab token - needs at least api and read_user scopes.TERMINUS_BUILD_TOOLS_COMPOSER_AUTH
JSON formatted object to be used for composer authentication. See https://getcomposer.org/doc/03-cli.md#composer-auth
It is possible to add other providers. There is no plugin mechanism for providers; additional implementations must be added to the Terminus Build Tools plugin. Pull requests are welcome.
In the ProviderManager class, add the classname to the list in the findProvider
method.
Follow the example provided by the CircleCIProvider class. A number of interfaces should be implemented:
- CredentialClientInterface: declare the credentials (e.g. OAuth tokens) the CredentialManager shoud look up or prompt for on behalf of your CI Provider.
- CIProvider: set environment variables and configure the CI service to begin running tests.
- PrivateKeyReceiver: receive the private key that will be generated for your CI Provider. The corresponding public key is added to Pantheon.
- LoggerAwareInterface: A logger will be injected into your class.
Follow the example provided by the GithubProvider class. A number of interfaces should be implemented:
- CredentialClientInterface: declare the credentials (e.g. OAuth tokens) the CredentialManager shoud look up or prompt for on behalf of your CI Provider.
- GitProvider: create a repository on the remote Git service, and push a local repository to the remote service.
- LoggerAwareInterface: A logger will be injected into your class.