facebook twitter hatena line email

「Php/deploy/deployer/slack」の版間の差分

提供: 初心者エンジニアの簡易メモ
移動: 案内検索
(slack-deployer連携)
 
行3: 行3:
  
 
deployer/recipesが6以上
 
deployer/recipesが6以上
 +
 +
php5.6のdeployer4でrecipes6のslackが動作しなかった。recipes5はver自体が存在しなくrecipes4だとslackが存在しない。
  
 
==slackのrecipeインストール==
 
==slackのrecipeインストール==

2018年3月15日 (木) 10:08時点における最新版

slack-deployer連携

php7以上で出ないと多分使えない。

deployer/recipesが6以上

php5.6のdeployer4でrecipes6のslackが動作しなかった。recipes5はver自体が存在しなくrecipes4だとslackが存在しない。

slackのrecipeインストール

composer require deployer/recipes --dev

composer.json確認

"deployer/recipes": "^6.0"

slack_access_token取得

https://deployer.org/recipes/slack から"add to slack"ボタンを押してslack内にdeployerアプリを作る

サンプルコード

require 'recipe/slack.php';
set('slack_webhook', 'ttps://hooks.slack.com/services/xxxxxxxxxxxxxxxxx');
before('deploy', 'slack:notify');
after('success', 'slack:notify:success');
after('deploy:failed', 'slack:notify:failure');


slackメッセージサンプル

Deployer アプリ [12:53]
 アプリ名1
 _no_user_ deploying `staging` to *staging*
 アプリ名1
 Deploy to *staging* successful