{"_id":"573ed4bea233380e005db15c","githubsync":"","project":"56b86cc286d2b0190070bcda","category":{"_id":"573ed4bea233380e005db14e","__v":0,"version":"573ed4bea233380e005db14d","project":"56b86cc286d2b0190070bcda","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-08T10:24:03.768Z","from_sync":false,"order":0,"slug":"documentation","title":"Documentation"},"__v":1,"user":"56b86c990094520d006b3c33","version":{"_id":"573ed4bea233380e005db14d","__v":2,"project":"56b86cc286d2b0190070bcda","createdAt":"2016-05-20T09:11:26.847Z","releaseDate":"2016-05-20T09:11:26.847Z","categories":["573ed4bea233380e005db14e","573ed4bea233380e005db14f","573ed4bea233380e005db150","578bcf36bb7d810e00e01c05"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"master","version_clean":"0.3.0-0.4","version":"0.3-0.4"},"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-09T14:01:00.845Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":3,"body":"The connection adapters are the 'middleman' that executes the actual commands, sent by the various configured tasks, on the (remote) server.\nThis allows Accompli to support multiple connection types.\n\nAccompli provides the following connection adapters for connecting to a (remote) server:\n\n* [LocalConnectionAdapter](doc:LocalConnectionAdapter)\n* [SSHConnectionAdapter](doc:SSHConnectionAdapter)\n\n## Creating your own connection adapter\nAll connection adapters must implement the `Accompli\\Deployment\\Connection\\ConnectionAdapterInterface`.\n\n### Configuring your custom connection adapter\nYou configure your custom connection adapter by adding a unique key and the FQCN of the connection adapter to the `accompli.json` of your project or within a recipe.\n\nYou can then use the unique key of the connection adapter to use as `connectionType` with a host configuration.\n\nThe following configuration shows an example on how to configure a custom connection adapter:\n``` json\n{\n    \"$extend\": \"accompli://recipe/defaults.json\",\n    \"hosts\": [\n        {\n            \"stage\": \"test\",\n            \"connectionType\": \"custom\",\n            \"hostname\": \"example.com\",\n            \"path\": \"/var/www/example.com\"\n        }\n    ],\n    \"deployment\": {\n        \"connection\": {\n            \"custom\": \"My\\\\Custom\\\\ConnectionAdapter\"\n        }\n    }\n}\n```","excerpt":"","slug":"connection-adapters","type":"basic","title":"Connection adapters"}

Connection adapters


The connection adapters are the 'middleman' that executes the actual commands, sent by the various configured tasks, on the (remote) server. This allows Accompli to support multiple connection types. Accompli provides the following connection adapters for connecting to a (remote) server: * [LocalConnectionAdapter](doc:LocalConnectionAdapter) * [SSHConnectionAdapter](doc:SSHConnectionAdapter) ## Creating your own connection adapter All connection adapters must implement the `Accompli\Deployment\Connection\ConnectionAdapterInterface`. ### Configuring your custom connection adapter You configure your custom connection adapter by adding a unique key and the FQCN of the connection adapter to the `accompli.json` of your project or within a recipe. You can then use the unique key of the connection adapter to use as `connectionType` with a host configuration. The following configuration shows an example on how to configure a custom connection adapter: ``` json { "$extend": "accompli://recipe/defaults.json", "hosts": [ { "stage": "test", "connectionType": "custom", "hostname": "example.com", "path": "/var/www/example.com" } ], "deployment": { "connection": { "custom": "My\\Custom\\ConnectionAdapter" } } } ```