https://github.com/masterfermin02/cloudways-deployment
A deployment tool written in PHP to deploy apps to cloudways.
https://github.com/masterfermin02/cloudways-deployment
Last synced: about 1 year ago
JSON representation
A deployment tool written in PHP to deploy apps to cloudways.
- Host: GitHub
- URL: https://github.com/masterfermin02/cloudways-deployment
- Owner: masterfermin02
- License: bsd-3-clause
- Created: 2021-03-13T19:23:38.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-03-23T14:25:23.000Z (over 5 years ago)
- Last Synced: 2025-05-31T12:21:58.007Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 44.9 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README

# cloudways-deployment
[](https://img.shields.io/github/issues/masterfermin02/cloudways-deployment)
[](https://img.shields.io/github/stars/masterfermin02/cloudways-deployment)
[](LICENSE.md)
A deployment tool written in PHP to deploy apps to cloudways.
## Installation and usage
This package requires PHP 8 or higher.
- Install by composer
```bash
composer require masterfermin02/cloud-ways-deploy
```
# Use
- Config your git webhook [doc](https://docs.github.com/en/developers/webhooks-and-events/creating-webhooks)
- Deploy example script:
```php
load();
use App\Input;
use CloudWays\Deploy\Client;
use CloudWays\Requester;
use CloudWays\Server;
$apiKey = $_ENV['API_KEY']; // API key clouds ways key
$API_URL = $_ENV['API_URL']; // your cloudways server api url
$email = $_ENV['DEPLOYMENT_EMAIL']; // your email to receive notifiy on deploy finish
$input = Input::create(array_merge($_GET, $_POST));
// git web hook example url http://yourserver/deployApplication.php?server_id=1234&app_id=1234&git_url=git_url&branch_name=master&deploy_path=path_to_your_app
$gitPullResponse = Client::create($email, $apiKey, Requester::create($API_URL))
->execute(Server::create(
$input->get('server_id'),
$input->get('git_url'),
$input->get('branch_name'),
$input->get('app_id')
));
echo (json_encode($gitPullResponse));
```
## Testing
Run the tests with:
``` bash
composer test
```
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Credits
- [Fermin Perdomo](https://github.com/masterfermin02)
- [All Contributors](../../contributors)