美文网首页
PHP 自动部署笔记

PHP 自动部署笔记

作者: 弹猪 | 来源:发表于2017-04-12 16:44 被阅读0次
Paste_Image.png

第一步 Git 得到待检测php文件
version=git log --pretty=format:"%H" -1 --author=yidao
author=git log --pretty=format:"%an" -1
email=git log --pretty=format:"%ae" -1
files=git diff-tree --no-commit-id --name-only -r $version | grep "Lib*" |sed -e 's/\s/,/g'
files=echo $files|sed -e 's/\s/,/g'

2 Phpmd
phpmd $files html codesize,unusedcode --reportfile build/logs/$version.html

3 Phpunit
phpunit --testsuite all

phpunit.xml基础配置之外加上

Paste_Image.png

4 Mail 发邮件给开发者
邮件内容写入build/logs/mail

Paste_Image.png

mail -s "PHPMD && PHPUNIT report" $email < build/logs/mail

相关文章

网友评论

      本文标题:PHP 自动部署笔记

      本文链接:https://www.haomeiwen.com/subject/sdlxwttx.html