digitalocean/ember-cli-deploy-sentry

Name: ember-cli-deploy-sentry

Owner: DigitalOcean

Description: An ember-cli-deploy-plugin to upload javascript sourcemaps to Sentry

Forked from: magicgrl111/ember-cli-deploy-sentry

Created: 2016-10-17 18:16:38.0

Updated: 2017-02-07 07:49:59.0

Pushed: 2017-05-11 13:45:41.0

Homepage:

Size: 51

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Ember-cli-deploy-sentry Circle CI

An ember-cli-deploy-plugin to upload javascript sourcemaps to Sentry.

What is an ember-cli-deploy plugin?

A plugin is an addon that can be executed as a part of the ember-cli-deploy pipeline. A plugin will implement one or more of the ember-cli-deploy's pipeline hooks.

For more information on what plugins are and how they work, please refer to the Plugin Documentation.

Quick Start

To get up and running quickly, do the following:

ber install ember-cli-deploy-sentry
sentry = {
blicUrl: 'https://your.awesome.site',
ntryUrl: 'https://sentry.your.awesome.site',
ntryOrganizationSlug: 'AwesomeOrg',
ntryProjectSlug: 'AwesomeProject',
 One of:
iKey: 'awesomeApiKey',
 or
arerApiKey: 'awesomeApiKey'

Install ember-cli-sentry but import the raven service from ember-cli-deploy-sentry/services/raven, which will automatically handle setting up the release version for you. Sentry needs this to find the correct sourcemap for an error that occurs.

If you don't want to use ember-cli-sentry but set raven-js up manually see Manual integration with raven-js.

ember-cli builds sourcemaps only in development environment by default. In order to build them always, just add the following to your EmberApp options.

cemaps: {
abled: true,
tensions: ['js']

See also: ember-cli documentation

ber deploy
Installation

Run the following command in your terminal:

r install ember-cli-deploy-sentry

For general information on how to setup Sentry and raven-js you probably want to check out the official Sentry Documentation especially on Sourcemaps.

ember-cli-deploy Hooks Implemented

For detailed information on what plugin hooks are and how they work, please refer to the Plugin Documentation.

Configuration Options

For detailed information on how configuration of plugins works, please refer to the Plugin Documentation.

publicUrl

The public url to the root of where your assets are stored. For instance, if your assets are stored on Cloudfront, it would be https://xxxx.cloudfront.net.

Required

sentryUrl

The url of the sentry installation that ember-cli-deploy-sentry shall upload sourcemaps and javascript files to. If you are deploying in your local network, keep in mind you might need to use the local hostname/IP address.

Required

sentryOrganizationSlug

The slug of the organization you want to upload sourcemaps for. You can specify this in organization settings in sentry.

Required

sentryProjectSlug

The slug of the project you want to upload sourcemaps for. You can specify this in project settings in sentry.

Required

apiKey or bearerApiKey

Either an HTTP Basic Auth username, or a bearer token. If you are uploading to the current Sentry API, use the latter. Use the former if you are using an older API.

You can create the api key in your organization settings. Make sure it has the project:write privilege.

Required

distDir

The root directory that all files matching the filePattern will be uploaded from. By default, this option will use the distDir property of the deployment context.

Default: context.distDir

didDeployMessage

A message that will be displayed after the distDir has been copied to destDir.

Default:

  didDeployMessage: function(context){
  return "Uploaded sourcemaps to sentry release: "
    + this.readConfig('sentryUrl')
    + '/'
    + this.readConfig('sentryOrganizationSlug')
    + '/'
    + this.readConfig('sentryProjectSlug')
    + '/releases/'
    + this.readConfig('revisionKey')
    + '/';
}
filePattern

minimatch expression that is used to determine which files should be uploaded from the distDir.

Default: /**/*.{js,map}

revisionKey

The revision string that is used to create releases in sentry.

visionKey: function(context) {
return context.revisionData && context.revisionData.revisionKey;

enableRevisionTagging

Enable adding a meta tag with the current revisionKey into the head of your index.html.

Default true

replaceFiles

At deploy-time, the plugin will check your Sentry instance for an existing release under the current revisionKey. If a release is found and this is set to true, all existing files for the matching release will be deleted before the current build's files are uploaded to Sentry. If this is set to false, the files on Sentry will remain untouched and the just-built files will not be uploaded.

Default true

Prerequisites

The following properties are expected to be present on the deployment context object:

Manual integration with raven-js

By default a meta tag with the key name sentry:revision is inserted in your index.html:

a name="sentry:revision" content="(revision)">

When you setup raven-js you can retrieve it like this:

n.config({
release: $("meta[name='sentry:revision']").attr('content')

If you only want to use the sourcemap upload functionality of ember-cli-deploy-sentry, you can disable automatic meta tag insertion completely by setting enableRevisionTagging to false.

Last but not least make sure to setup proper exception catching like this.

Running Tests
TODO
State

It works. We use it in production at Hatchet.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.