Ms-teams Recipe
require 'contrib/ms-teams.php';
Installing
Require ms-teams recipe in your deploy.php
file:
Setup:
- Open MS Teams
- Navigate to Teams section
- Select existing or create new team
- Select existing or create new channel
- Hover over channel to get three dots, click, in menu select "Connectors"
- Search for and configure "Incoming Webhook"
- Confirm/create and copy your Webhook URL
- Setup deploy.php Add in header:
require 'contrib/ms-teams.php';
set('teams_webhook', 'https://outlook.office.com/webhook/...');
Add in content:
before('deploy', 'teams:notify');
after('deploy:success', 'teams:notify:success');
after('deploy:failed', 'teams:notify:failure');
9.) Sip your coffee
Configuration
teams_webhook
– teams incoming webhook url, requiredset('teams_webhook', 'https://outlook.office.com/webhook/...');
teams_title
– the title of application, default{{application}}
teams_text
– notification message template, markdown supportedset('teams_text', '_{{user}}_ deploying `{{what}}` to *{{where}}*');
teams_success_text
– success template, default:set('teams_success_text', 'Deploy to *{{where}}* successful');
teams_failure_text
– failure template, default:set('teams_failure_text', 'Deploy to *{{where}}* failed');
teams_color
– color's attachmentteams_success_color
– success color's attachmentteams_failure_color
– failure color's attachment
Usage
If you want to notify only about beginning of deployment add this line only:
before('deploy', 'teams:notify');
If you want to notify about successful end of deployment add this too:
after('deploy:success', 'teams:notify:success');
If you want to notify about failed deployment add this too:
after('deploy:failed', 'teams:notify:failure');
Configuration
teams_title
Title of project
Default value
return get('application', 'Project');
teams_text
Deploy message
Default value
'_{{user}}_ deploying `{{what}}` to *{{where}}*'
teams_success_text
Default value
'Deploy to *{{where}}* successful'
teams_failure_text
Default value
'Deploy to *{{where}}* failed'
teams_color
Color of attachment
Default value
'#4d91f7'
teams_success_color
Default value
'#00c100'
teams_failure_color
Default value
'#ff0909'
Tasks
teams:notify
Notifies Teams.
teams:notify:success
Notifies Teams about deploy finish.
teams:notify:failure
Notifies Teams about deploy failure.