mirror of
https://github.com/deployphp/deployer.git
synced 2025-02-24 01:02:24 +01:00
169 lines
3.8 KiB
Markdown
169 lines
3.8 KiB
Markdown
|
<!-- DO NOT EDIT THIS FILE! -->
|
|||
|
<!-- Instead edit contrib/cimonitor.php -->
|
|||
|
<!-- Then run bin/docgen -->
|
|||
|
|
|||
|
# cimonitor
|
|||
|
|
|||
|
[Source](/contrib/cimonitor.php)
|
|||
|
|
|||
|
|
|||
|
# CIMonitor recipe
|
|||
|
|
|||
|
Monitor your deployments on [CIMonitor](https://github.com/CIMonitor/CIMonitor).
|
|||
|
|
|||
|

|
|||
|
|
|||
|
Require cimonitor recipe in your `deploy.php` file:
|
|||
|
|
|||
|
```php
|
|||
|
require 'contrib/cimonitor.php';
|
|||
|
```
|
|||
|
|
|||
|
Add tasks on deploy:
|
|||
|
|
|||
|
```php
|
|||
|
before('deploy', 'cimonitor:notify');
|
|||
|
after('success', 'cimonitor:notify:success');
|
|||
|
after('deploy:failed', 'cimonitor:notify:failure');
|
|||
|
```
|
|||
|
|
|||
|
## Configuration
|
|||
|
|
|||
|
- `cimonitor_webhook` – CIMonitor server webhook url, **required**
|
|||
|
```
|
|||
|
set('cimonitor_webhook', 'https://cimonitor.enrise.com/webhook/deployer');
|
|||
|
```
|
|||
|
- `cimonitor_title` – the title of application, default the username\reponame combination from `{{repository}}`
|
|||
|
```
|
|||
|
set('cimonitor_title', '');
|
|||
|
```
|
|||
|
- `cimonitor_user` – User object with name and email, default gets information from `git config`
|
|||
|
```
|
|||
|
set('cimonitor_user', function () {
|
|||
|
return [
|
|||
|
'name' => 'John Doe',
|
|||
|
'email' => 'john@enrise.com',
|
|||
|
];
|
|||
|
});
|
|||
|
```
|
|||
|
|
|||
|
Various cimonitor statusses are set, in case you want to change these yourselves. See the [CIMonitor documentation](https://cimonitor.readthedocs.io/en/latest/) for the usages of different states.
|
|||
|
|
|||
|
## Usage
|
|||
|
|
|||
|
If you want to notify only about beginning of deployment add this line only:
|
|||
|
|
|||
|
```php
|
|||
|
before('deploy', 'cimonitor:notify');
|
|||
|
```
|
|||
|
|
|||
|
If you want to notify about successful end of deployment add this too:
|
|||
|
|
|||
|
```php
|
|||
|
after('success', 'cimonitor:notify:success');
|
|||
|
```
|
|||
|
|
|||
|
If you want to notify about failed deployment add this too:
|
|||
|
|
|||
|
```php
|
|||
|
after('deploy:failed', 'cimonitor:notify:failure');
|
|||
|
```
|
|||
|
|
|||
|
|
|||
|
* Config
|
|||
|
* [`cimonitor_title`](#cimonitor_title)
|
|||
|
* [`cimonitor_user`](#cimonitor_user)
|
|||
|
* [`cimonitor_status_info`](#cimonitor_status_info)
|
|||
|
* [`cimonitor_status_warning`](#cimonitor_status_warning)
|
|||
|
* [`cimonitor_status_error`](#cimonitor_status_error)
|
|||
|
* [`cimonitor_status_success`](#cimonitor_status_success)
|
|||
|
* [`cimonitor_job_state_info`](#cimonitor_job_state_info)
|
|||
|
* [`cimonitor_job_state_pending`](#cimonitor_job_state_pending)
|
|||
|
* [`cimonitor_job_state_running`](#cimonitor_job_state_running)
|
|||
|
* [`cimonitor_job_state_warning`](#cimonitor_job_state_warning)
|
|||
|
* [`cimonitor_job_state_error`](#cimonitor_job_state_error)
|
|||
|
* [`cimonitor_job_state_success`](#cimonitor_job_state_success)
|
|||
|
* Tasks
|
|||
|
* [`cimonitor:notify`](#cimonitornotify) — Notifying CIMonitor
|
|||
|
* [`cimonitor:notify:success`](#cimonitornotifysuccess) — Notifying CIMonitor about deploy finish
|
|||
|
* [`cimonitor:notify:failure`](#cimonitornotifyfailure) — Notifying CIMonitor about deploy failure
|
|||
|
|
|||
|
## Config
|
|||
|
### cimonitor_title
|
|||
|
[Source](/contrib/cimonitor.php#L70)
|
|||
|
|
|||
|
Title of project based on git repo
|
|||
|
|
|||
|
### cimonitor_user
|
|||
|
[Source](/contrib/cimonitor.php#L75)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
### cimonitor_status_info
|
|||
|
[Source](/contrib/cimonitor.php#L83)
|
|||
|
|
|||
|
CI monitor status states and job states
|
|||
|
|
|||
|
### cimonitor_status_warning
|
|||
|
[Source](/contrib/cimonitor.php#L84)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
### cimonitor_status_error
|
|||
|
[Source](/contrib/cimonitor.php#L85)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
### cimonitor_status_success
|
|||
|
[Source](/contrib/cimonitor.php#L86)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
### cimonitor_job_state_info
|
|||
|
[Source](/contrib/cimonitor.php#L87)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
### cimonitor_job_state_pending
|
|||
|
[Source](/contrib/cimonitor.php#L88)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
### cimonitor_job_state_running
|
|||
|
[Source](/contrib/cimonitor.php#L89)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
### cimonitor_job_state_warning
|
|||
|
[Source](/contrib/cimonitor.php#L90)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
### cimonitor_job_state_error
|
|||
|
[Source](/contrib/cimonitor.php#L91)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
### cimonitor_job_state_success
|
|||
|
[Source](/contrib/cimonitor.php#L92)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
## Tasks
|
|||
|
### cimonitor:notify
|
|||
|
[Source](/contrib/cimonitor.php#L95)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
### cimonitor:notify:success
|
|||
|
[Source](/contrib/cimonitor.php#L122)
|
|||
|
|
|||
|
|
|||
|
|
|||
|
### cimonitor:notify:failure
|
|||
|
[Source](/contrib/cimonitor.php#L151)
|
|||
|
|
|||
|
|
|||
|
|