Skip to content

Commit

Permalink
Add new config options: {{what}} and {{where}}
Browse files Browse the repository at this point in the history
  • Loading branch information
antonmedv committed Oct 22, 2024
1 parent 5cefd19 commit 492078b
Show file tree
Hide file tree
Showing 24 changed files with 174 additions and 123 deletions.
12 changes: 6 additions & 6 deletions contrib/discord.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
- `discord_notify_text` – notification message template, markdown supported, default:
```markdown
:information_source: **{{user}}** is deploying branch `{{branch}}` to _{{target}}_
:information_source: **{{user}}** is deploying branch `{{branch}}` to _{{where}}_
```
- `discord_success_text` – success template, default:
```markdown
:white_check_mark: Branch `{{branch}}` deployed to _{{target}}_ successfully
:white_check_mark: Branch `{{branch}}` deployed to _{{where}}_ successfully
```
- `discord_failure_text` – failure template, default:
```markdown
:no_entry_sign: Branch `{{branch}}` has failed to deploy to _{{target}}_
:no_entry_sign: Branch `{{branch}}` has failed to deploy to _{{where}}_
## Usage
Expand Down Expand Up @@ -58,17 +58,17 @@
// Deploy messages
set('discord_notify_text', function () {
return [
'text' => parse(':information_source: **{{user}}** is deploying branch `{{branch}}` to _{{target}}_'),
'text' => parse(':information_source: **{{user}}** is deploying branch `{{what}}` to _{{where}}_'),
];
});
set('discord_success_text', function () {
return [
'text' => parse(':white_check_mark: Branch `{{branch}}` deployed to _{{target}}_ successfully'),
'text' => parse(':white_check_mark: Branch `{{what}}` deployed to _{{where}}_ successfully'),
];
});
set('discord_failure_text', function () {
return [
'text' => parse(':no_entry_sign: Branch `{{branch}}` has failed to deploy to _{{target}}_'),
'text' => parse(':no_entry_sign: Branch `{{what}}` has failed to deploy to _{{where}}_'),
];
});

Expand Down
6 changes: 3 additions & 3 deletions contrib/hipchat.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- `hipchat_token` – Hipchat V1 auth token
- `hipchat_room_id` – Room ID or name
- `hipchat_message` – Deploy message, default is `_{{user}}_ deploying `{{branch}}` to *{{target}}*`
- `hipchat_message` – Deploy message, default is `_{{user}}_ deploying `{{what}}` to *{{where}}*`
- `hipchat_from` – Default to target
- `hipchat_color` – Message color, default is **green**
- `hipchat_url` – The URL to the message endpoint, default is https://api.hipchat.com/v1/rooms/message
Expand All @@ -24,8 +24,8 @@
use Deployer\Utility\Httpie;

set('hipchat_color', 'green');
set('hipchat_from', '{{target}}');
set('hipchat_message', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
set('hipchat_from', '{{where}}');
set('hipchat_message', '_{{user}}_ deploying `{{what}}` to *{{where}}*');
set('hipchat_url', 'https://api.hipchat.com/v1/rooms/message');

desc('Notifies Hipchat channel of deployment');
Expand Down
12 changes: 6 additions & 6 deletions contrib/mattermost.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@
- `mattermost_text` - notification message
```
set('mattermost_text', '_{{user}}_ deploying `{{branch}}` to **{{target}}**');
set('mattermost_text', '_{{user}}_ deploying `{{what}}` to **{{where}}**');
```
- `mattermost_success_text` – success template, default:
```
set('mattermost_success_text', 'Deploy to **{{target}}** successful {{mattermost_success_emoji}}');
set('mattermost_success_text', 'Deploy to **{{where}}** successful {{mattermost_success_emoji}}');
```
- `mattermost_failure_text` – failure template, default:
```
set('mattermost_failure_text', 'Deploy to **{{target}}** failed {{mattermost_failure_emoji}}');
set('mattermost_failure_text', 'Deploy to **{{where}}** failed {{mattermost_failure_emoji}}');
```
- `mattermost_success_emoji` – emoji added at the end of success text
Expand Down Expand Up @@ -86,9 +86,9 @@
set('mattermost_success_emoji', ':white_check_mark:');
set('mattermost_failure_emoji', ':x:');

set('mattermost_text', '_{{user}}_ deploying `{{branch}}` to **{{target}}**');
set('mattermost_success_text', 'Deploy to **{{target}}** successful {{mattermost_success_emoji}}');
set('mattermost_failure_text', 'Deploy to **{{target}}** failed {{mattermost_failure_emoji}}');
set('mattermost_text', '_{{user}}_ deploying `{{what}}` to **{{where}}**');
set('mattermost_success_text', 'Deploy to **{{where}}** successful {{mattermost_success_emoji}}');
set('mattermost_failure_text', 'Deploy to **{{where}}** failed {{mattermost_failure_emoji}}');

desc('Notifies mattermost');
task('mattermost:notify', function () {
Expand Down
12 changes: 6 additions & 6 deletions contrib/ms-teams.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
- `teams_title` – the title of application, default `{{application}}`
- `teams_text` – notification message template, markdown supported
```
set('teams_text', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
set('teams_text', '_{{user}}_ deploying `{{what}}` to *{{where}}*');
```
- `teams_success_text` – success template, default:
```
set('teams_success_text', 'Deploy to *{{target}}* successful');
set('teams_success_text', 'Deploy to *{{where}}* successful');
```
- `teams_failure_text` – failure template, default:
```
set('teams_failure_text', 'Deploy to *{{target}}* failed');
set('teams_failure_text', 'Deploy to *{{where}}* failed');
```
- `teams_color` – color's attachment
Expand Down Expand Up @@ -81,9 +81,9 @@
});

// Deploy message
set('teams_text', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
set('teams_success_text', 'Deploy to *{{target}}* successful');
set('teams_failure_text', 'Deploy to *{{target}}* failed');
set('teams_text', '_{{user}}_ deploying `{{what}}` to *{{where}}*');
set('teams_success_text', 'Deploy to *{{where}}* successful');
set('teams_failure_text', 'Deploy to *{{where}}* failed');

// Color of attachment
set('teams_color', '#4d91f7');
Expand Down
12 changes: 6 additions & 6 deletions contrib/ntfy.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
- `ntfy_title` – the title of the message, default `{{application}}`
- `ntfy_text` – notification message template
```
set('ntfy_text', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
set('ntfy_text', '_{{user}}_ deploying `{{what}}` to *{{where}}*');
```
- `ntfy_tags` – notification message tags / emojis (comma separated)
```
Expand All @@ -44,7 +44,7 @@
```
- `ntfy_success_text` – success template, default:
```
set('ntfy_success_text', 'Deploy to *{{target}}* successful');
set('ntfy_success_text', 'Deploy to *{{where}}* successful');
```
- `ntfy_success_tags` – success tags / emojis (comma separated)
```
Expand All @@ -53,7 +53,7 @@
- `ntfy_success_priority` – success notification message priority
- `ntfy_failure_text` – failure template, default:
```
set('ntfy_failure_text', 'Deploy to *{{target}}* failed');
set('ntfy_failure_text', 'Deploy to *{{where}}* failed');
```
- `ntfy_failure_tags` – failure tags / emojis (comma separated)
```
Expand Down Expand Up @@ -95,9 +95,9 @@
});

// Deploy message
set('ntfy_text', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
set('ntfy_success_text', 'Deploy to *{{target}}* successful');
set('ntfy_failure_text', 'Deploy to *{{target}}* failed');
set('ntfy_text', '_{{user}}_ deploying `{{what}}` to *{{where}}*');
set('ntfy_success_text', 'Deploy to *{{where}}* successful');
set('ntfy_failure_text', 'Deploy to *{{where}}* failed');

// Message tags
set('ntfy_tags', '');
Expand Down
12 changes: 6 additions & 6 deletions contrib/rocketchat.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@
- `rocketchat_title` - the title of the application, defaults to `{{application}}`
- `rocketchat_text` - notification message
```
set('rocketchat_text', '_{{user}}_ deploying {{branch}} to {{target}}');
set('rocketchat_text', '_{{user}}_ deploying {{what}} to {{where}}');
```
- `rocketchat_success_text` – success template, default:
```
set('rocketchat_success_text', 'Deploy to *{{target}}* successful');
set('rocketchat_success_text', 'Deploy to *{{where}}* successful');
```
- `rocketchat_failure_text` – failure template, default:
```
set('rocketchat_failure_text', 'Deploy to *{{target}}* failed');
set('rocketchat_failure_text', 'Deploy to *{{where}}* failed');
```
- `rocketchat_color` – color's attachment
Expand Down Expand Up @@ -78,9 +78,9 @@
set('rocketchat_success_color', '#00c100');
set('rocketchat_failure_color', '#ff0909');

set('rocketchat_text', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
set('rocketchat_success_text', 'Deploy to *{{target}}* successful');
set('rocketchat_failure_text', 'Deploy to *{{target}}* failed');
set('rocketchat_text', '_{{user}}_ deploying `{{what}}` to *{{where}}*');
set('rocketchat_success_text', 'Deploy to *{{where}}* successful');
set('rocketchat_failure_text', 'Deploy to *{{where}}* failed');

desc('Notifies RocketChat');
task('rocketchat:notify', function () {
Expand Down
6 changes: 3 additions & 3 deletions contrib/rollbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- `rollbar_token` – access token to rollbar api
- `rollbar_comment` – comment about deploy, default to
```php
set('rollbar_comment', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
set('rollbar_comment', '_{{user}}_ deploying `{{what}}` to *{{where}}*');
```
- `rollbar_username` – rollbar user name
Expand All @@ -24,7 +24,7 @@

use Deployer\Utility\Httpie;

set('rollbar_comment', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
set('rollbar_comment', '_{{user}}_ deploying `{{what}}` to *{{where}}*');

desc('Notifies Rollbar of deployment');
task('rollbar:notify', function () {
Expand All @@ -34,7 +34,7 @@

$params = [
'access_token' => get('rollbar_token'),
'environment' => get('target'),
'environment' => get('where'),
'revision' => runLocally('git log -n 1 --format="%h"'),
'local_username' => get('user'),
'rollbar_username' => get('rollbar_username'),
Expand Down
14 changes: 7 additions & 7 deletions contrib/slack.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
- `slack_title` – the title of application, default `{{application}}`
- `slack_text` – notification message template, markdown supported
```
set('slack_text', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
set('slack_text', '_{{user}}_ deploying `{{what}}` to *{{where}}*');
```
- `slack_success_text` – success template, default:
```
set('slack_success_text', 'Deploy to *{{target}}* successful');
set('slack_success_text', 'Deploy to *{{where}}* successful');
```
- `slack_failure_text` – failure template, default:
```
set('slack_failure_text', 'Deploy to *{{target}}* failed');
set('slack_failure_text', 'Deploy to *{{where}}* failed');
```
- `slack_color` – color's attachment
Expand Down Expand Up @@ -75,10 +75,10 @@
});

// Deploy message
set('slack_text', '_{{user}}_ deploying `{{target}}` to *{{hostname}}*');
set('slack_success_text', 'Deploy to *{{target}}* successful');
set('slack_failure_text', 'Deploy to *{{target}}* failed');
set('slack_rollback_text', '_{{user}}_ rolled back changes on *{{target}}*');
set('slack_text', '_{{user}}_ deploying `{{what}}` to *{{where}}*');
set('slack_success_text', 'Deploy to *{{where}}* successful');
set('slack_failure_text', 'Deploy to *{{where}}* failed');
set('slack_rollback_text', '_{{user}}_ rolled back changes on *{{where}}*');
set('slack_fields', []);

// Color of attachment
Expand Down
12 changes: 6 additions & 6 deletions contrib/telegram.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@
- `telegram_title` – the title of application, default `{{application}}`
- `telegram_text` – notification message template
```
_{{user}}_ deploying `{{branch}}` to *{{target}}*
_{{user}}_ deploying `{{what}}` to *{{where}}*
```
- `telegram_success_text` – success template, default:
```
Deploy to *{{target}}* successful
Deploy to *{{where}}* successful
```
- `telegram_failure_text` – failure template, default:
```
Deploy to *{{target}}* failed
Deploy to *{{where}}* failed
```
## Usage
Expand Down Expand Up @@ -78,9 +78,9 @@
});

// Deploy message
set('telegram_text', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
set('telegram_success_text', 'Deploy to *{{target}}* successful');
set('telegram_failure_text', 'Deploy to *{{target}}* failed');
set('telegram_text', '_{{user}}_ deploying `{{what}}` to *{{where}}*');
set('telegram_success_text', 'Deploy to *{{where}}* successful');
set('telegram_failure_text', 'Deploy to *{{where}}* failed');


desc('Notifies Telegram');
Expand Down
12 changes: 6 additions & 6 deletions contrib/workplace.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@
- `workplace_text` - notification message
```
set('workplace_text', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
set('workplace_text', '_{{user}}_ deploying `{{what}}` to *{{where}}*');
```
- `workplace_success_text` – success template, default:
```
set('workplace_success_text', 'Deploy to *{{target}}* successful');
set('workplace_success_text', 'Deploy to *{{where}}* successful');
```
- `workplace_failure_text` – failure template, default:
```
set('workplace_failure_text', 'Deploy to *{{target}}* failed');
set('workplace_failure_text', 'Deploy to *{{where}}* failed');
```
- `workplace_edit_post` – whether to create a new post for deploy result, or edit the first one created, default creates a new post:
```
Expand Down Expand Up @@ -68,9 +68,9 @@
use Deployer\Utility\Httpie;

// Deploy message
set('workplace_text', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
set('workplace_success_text', 'Deploy to *{{target}}* successful');
set('workplace_failure_text', 'Deploy to *{{target}}* failed');
set('workplace_text', '_{{user}}_ deploying `{{what}}` to *{{where}}*');
set('workplace_success_text', 'Deploy to *{{where}}* successful');
set('workplace_failure_text', 'Deploy to *{{where}}* failed');

// By default, create a new post for every message
set('workplace_edit_post', false);
Expand Down
12 changes: 6 additions & 6 deletions contrib/yammer.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
- `yammer_title` – the title of application, default `{{application}}`
- `yammer_body` – notification message template, default:
```
<em>{{user}}</em> deploying {{branch}} to <strong>{{target}}</strong>
<em>{{user}}</em> deploying {{what}} to <strong>{{where}}</strong>
```
- `yammer_success_body` – success template, default:
```
Deploy to <strong>{{target}}</strong> successful
Deploy to <strong>{{where}}</strong> successful
```
- `yammer_failure_body` – failure template, default:
```
Deploy to <strong>{{target}}</strong> failed
Deploy to <strong>{{where}}</strong> failed
```
## Usage
Expand Down Expand Up @@ -60,9 +60,9 @@
});

// Deploy message
set('yammer_body', '<em>{{user}}</em> deploying {{branch}} to <strong>{{target}}</strong>');
set('yammer_success_body', 'Deploy to <strong>{{target}}</strong> successful');
set('yammer_failure_body', 'Deploy to <strong>{{target}}</strong> failed');
set('yammer_body', '<em>{{user}}</em> deploying {{what}} to <strong>{{where}}</strong>');
set('yammer_success_body', 'Deploy to <strong>{{where}}</strong> successful');
set('yammer_failure_body', 'Deploy to <strong>{{where}}</strong> failed');

desc('Notifies Yammer');
task('yammer:notify', function () {
Expand Down
Loading

0 comments on commit 492078b

Please sign in to comment.