定制 bkwld/codebasehq 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bkwld/codebasehq

Composer 安装命令:

composer require bkwld/codebasehq

包简介

Tools for integrating Laravel apps with CodebaseHQ features

README 文档

README

This is a Laravel Package that makes it easy to integrate with select Codebase features:

  • Pushing of exceptions, including full stack trace and all environment variables.
  • A command that can be used in a deploy script to log a deployment.
  • A command that can be used to comment on all tickets that were referenced in deployed git commit logs.

Installation

  1. Add it to your composer.json ("bkwld/codebasehq": "~4.0") and do a composer install.
  2. Add the service provider to your app.php config file providers: Bkwld\CodebaseHQ\ServiceProvider::class,.

Configuration

You will need to supply credentials to your CodebaseHQ account for this package to work. You can either store the following in your .env file (preferred) or publish and edit the config file for this package (php artisan vendor:publish --provider=="Bkwld\CodebaseHQ\ServiceProvider").

  • To log exceptions, only the project configs is required
  • For either deploy command, your user api creds are needed

.env options

# CodebaseHQ settings
CODEBASE_PROJECT_SLUG=
CODEBASE_PROJECT_KEY=
CODEBASE_API_USERNAME=
CODEBASE_API_KEY=
CODEBASE_LOG_EXCEPTIONS=

Usage

Exception Logging

This package listens for Laravel log events and pushes errors to CodebaseHQ. By default, exceptions fired from a local environment are not sent to CodebaseHQ. This can be changed by setting CODEBASE_LOG_EXCEPTIONS explicitly to true in your local .env file. You can control which exceptions don't get sent to CodebaseHQ by editing your app's App\Exceptions\Handler::$dontReport variable.

Deploy notifications

DeployHQ has a "Deployments" tab, found within your repo, that lists deployments. You can add to this list using the codebasehq:deploy command. It accepts the following options, which mimic those found in the API docs.

  • servers required - List of servers which you are deploying to (multiple servers should be comma separated, e.g. app1.myapp.com, app2.myapp.com, app3.myapp.com).
  • branch - The branch which you are deploying. This defaults to the currently checked out branch.
  • revision - The reference of the revision/commit you are deploying. It defaults to the HEAD commit.
  • deploy-env - The environment you are pushing to.

Examples:

php artisan codebasehq:deploy app1.myapp.com
php artisan codebasehq:deploy production --branch=production

Notify tickets of deployments

This command is designed to be run as part of a deploy script and requires you using the CodebaseHQ feature of linking to tickets from commit messages (ex: [touch:12]). By piping the output from git log for the commits you are deploying to php artisan codebasehq:deploy-tickets, the package will scan the logs for ticket references and then update those tickets that they have been deployed. Here's some examples:

# Get all the commits that aren't on staging/master but are local
git log staging/master..master | php artisan codebasehq:deploy-tickets

# The same as before, but fetch first so the diff is up to date
git fetch staging && git log staging/master..master | php artisan codebasehq:deploy-tickets

# Specify which server environment you are deploying to
git fetch staging && git log staging/master..master | php artisan codebasehq:deploy-tickets --server=staging

# Save the the log before you deploy, then tell CodebaseHQ about it after
git fetch staging && git log staging/master..master > /tmp/deployed-staging-commits.log
run-deploy-code
cat /tmp/deployed-staging-commits.log | php artisan codebasehq:deploy-tickets --server=staging
rm /tmp/deployed-staging-commits.log

Here is an example of what will get appended to the ticket:

Deployed message within a ticket

bkwld/codebasehq 适用场景与选型建议

bkwld/codebasehq 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10.42k 次下载、GitHub Stars 达 6, 最近一次更新时间为 2013 年 05 月 31 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 bkwld/codebasehq 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 bkwld/codebasehq 我们能提供哪些服务?
定制开发 / 二次开发

基于 bkwld/codebasehq 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 10.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 6
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 9
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-05-31