deployerでデプロイ時に通知する様にした
deploy/deploy.php
task('slack_alert', function() {
//どの環境にデプロイしているのか取得
$stage = input()->getArgument('stage');
//デプロイ先ディレクトリ
$path = run('pwd');
$result = run('echo "phocaseデプロイ完了したよ〜"');
//メンションをつける、 @hereを使いたい場合は特殊な書き方となり <!here> と記述します
$team = "@hogehoge";
$message = '\"'.$team.$path.":".$stage."環境に".$result.'\"';
$command = 'curl -s -S -X POST --data-urlencode "payload={\"link_names\" : 1, \"channel\": \"#送信チャンネル名\", \"username\": \"umaru\", \"icon_emoji\": \":umaru:\", \"text\": '.$message.' }" "slackのweb hook APIのキーをここに記述" >/dev/null';
run($command);
});
after('deploy', 'slack_alert');
※うまるちゃんのアイコンは各自入れてください。。。