2017 © Pedro Peláez
 

library codebasehq

Tools for integrating Laravel apps with CodebaseHQ features

image

bkwld/codebasehq

Tools for integrating Laravel apps with CodebaseHQ features

  • Thursday, September 14, 2017
  • by weotch
  • Repository
  • 8 Watchers
  • 4 Stars
  • 10,234 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 20 Versions
  • 1 % Grown

The README.md

CodebaseHQ

This is a Laravel Package that makes it easy to integrate with select Codebase features:, (*1)

  • 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")., (*2)

  • 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., (*3)

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., (*4)

  • 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:, (*5)

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:, (*6)

# 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:, (*7)

Deployed message within a ticket, (*8)

The Versions

14/09 2017

dev-master

9999999-dev

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

14/09 2017

4.1.2

4.1.2.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

13/09 2017

4.1.1

4.1.1.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

13/09 2017

4.1.0

4.1.0.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

18/07 2017

4.0.0

4.0.0.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

12/06 2015

3.2.3

3.2.3.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

12/06 2015

3.2.2

3.2.2.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

05/06 2015

3.2.1

3.2.1.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

23/07 2014

3.2.0

3.2.0.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

19/06 2014

3.1.0

3.1.0.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

15/04 2014

3.0.6

3.0.6.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

06/01 2014

3.0.5

3.0.5.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

05/11 2013

3.0.4

3.0.4.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

29/10 2013

3.0.3

3.0.3.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

28/10 2013

3.0.2

3.0.2.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

28/10 2013

3.0.1

3.0.1.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

28/10 2013

3.0.0

3.0.0.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

31/05 2013

2.0.2

2.0.2.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

31/05 2013

2.0.1

2.0.1.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

MIT

The Requires

 

by Robert Reinhard

31/05 2013

2.0.0

2.0.0.0

Tools for integrating Laravel apps with CodebaseHQ features

  Sources   Download

The Requires

 

by Robert Reinhard