Skip to main content
Version: 7.x

ms-teams

Source

Installing#

Require ms-teams recipe in your deploy.php file:

Setup:

  1. Open MS Teams
  2. Navigate to Teams section
  3. Select existing or create new team
  4. Select existing or create new channel
  5. Hover over channel to get tree dots, click, in menu select "Connectors"
  6. Search for and configure "Incoming Webhook"
  7. Confirm/create and copy your Webhook URL
  8. 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, required

    set('teams_webhook', 'https://outlook.office.com/webhook/...');
  • teams_title โ€“ the title of application, default {{application}}

  • teams_text โ€“ notification message template, markdown supported

    set('teams_text', '_{{user}}_ deploying `{{branch}}` to *{{target}}*');
  • teams_success_text โ€“ success template, default:

    set('teams_success_text', 'Deploy to *{{target}}* successful');
  • teams_failure_text โ€“ failure template, default:

    set('teams_failure_text', 'Deploy to *{{target}}* failed');
  • teams_color โ€“ color's attachment

  • teams_success_color โ€“ success color's attachment

  • teams_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#

Source

Title of project

teams_text#

Source

Deploy message

Default value
'_{{user}}_ deploying `{{branch}}` to *{{target}}*'

teams_success_text#

Source

Default value
'Deploy to *{{target}}* successful'

teams_failure_text#

Source

Default value
'Deploy to *{{target}}* failed'

teams_color#

Source

Color of attachment

Default value
'#4d91f7'

teams_success_color#

Source

Default value
'#00c100'

teams_failure_color#

Source

Default value
'#ff0909'

Tasks#

teams:notify#

Source

Notifying Teams.

teams:notify:success#

Source

Notifying Teams about deploy finish.

teams:notify:failure#

Source

Notifying Teams about deploy failure.