0.2.0 • Published 6 years ago

ember-cli-deploy-bugsnag v0.2.0

Weekly downloads
1,648
License
MIT
Repository
github
Last release
6 years ago

ember-cli-deploy-bugsnag

NPM release Build Ember Observer

An Ember CLI Deploy plugin for uploading sourcemaps to Bugsnag.

To send errors to Bugsnag, see ember-cli-bugsnag.

Installation

  • ember install ember-cli-deploy ember-cli-deploy-build ember-cli-deploy-bugsnag

Quick start

Enable sourcemaps for all environments in ember-cli-build.js:

/* jshint node:true */
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');

module.exports = function(defaults) {
  var app = new EmberApp(defaults, {
    // …
    sourcemaps: {
      enabled: true, // This allows sourcemaps to be generated in all environments
      extensions: ['js']
    }
  });

Set Bugsnag options in your config/deploy.js. The following example assumes the values for the options will be set as environment variables on your server.

  /* jshint node: true */

  module.exports = function(deployTarget) {
    // …

    ENV['bugsnag'] = {
      apiKey: process.env.BUGSNAG_KEY,
      publicUrl: process.env.BUGSNAG_PUBLIC_URL,
    };

    // …

    return ENV;
  };

Config Options

ember-cli-deploy-bugsnag options

Set in config/deploy.js:

NameTypeRequiredDefaultDescription
apiKeystringYes<none>Your Bugsnag Notifier API key.
distFilesarray of stringsNocontext.distFilesThe array of built project files. This option should be relative to distDir. By default, this option will use the distFiles property of the deployment context.
overwritestringNotrueIf set to false, existing sourcemaps for the same version of your app will not be overwritten. Options are true or false.
publicUrlstringYes<none>The fully qualified domain name for your application e.g., https://app.fancy-app.com
includeAppVersionbooleanNotrueWhether to tag the uploaded sourcemaps as belonging to a particular app version.

Related plugin options

Set by other Ember CLI Deploy plugins:

NameTypeDefaultDescriptionPlugin
distDirstringtmp/deploy-distThe path to your app's distribution directory.ember-cli-build
revisionKeystring<none>The unique identifier of a build based on its git tag.ember-cli-deploy-revision-data
gzippedFilesarray<none>A list of files that have been gzipped in the build.ember-cli-deploy-gzip

Deploying to Heroku

Add Heroku's Ember buildpack:

  heroku buildpacks:set https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/emberjs.tgz

Heroku strips away git information, so this addon grabs the revision info from the SOURCE_VERSION environment variable Heroku provides. Then you need to add the following to config/environment.js:

  /* jshint node: true */
  module.exports = function(environment) {
    // …
    if (environment === 'production') {
      // …
      ENV.currentRevision = process.env.SOURCE_VERSION;
      // …
    }
    // …
    return ENV;
  };

Developing

Running

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server