Code Monkey home page Code Monkey logo

Comments (13)

roncohen avatar roncohen commented on May 13, 2024

Seems like a good idea. I guess the use case is: With systems that SSH into servers to do deployments (Capistrano, Fabric etc), it's convenient to be able to run a command from the commandline that utilizes the same Opbeat credentials that are already set up on the server. Our Capistrano integration does this for Ruby projects: https://github.com/opbeat/opbeat_ruby/blob/master/lib/opbeat/capistrano/capistrano2.rb

What do you think @watson ?

from opbeat-node.

evantahler avatar evantahler commented on May 13, 2024

With node, there are still a lot of flavours of deployment tools (unlike the ruby standardization on capistrano). That's why I suggest that this library just expose the method rather than try to integrate with the deploy tools directly. We actually use capistrano to deploy node at TaskRabbit, but that's another topic..

It's important to note that the working directory may not be the root of the git repo, so I think that passing path is important (where to inspect the current git revision, etc)

The way we handled this with airbrake is that we wrapped airbrake.client.trackDeployment() in a grunt script we had capistrano call after deploy, ie:

grunt.registerTask('notifyAirbrakeDeploy','tell airbrake we deployed',function(message){
  var done = this.async()
  init(function(api){
    api.airbrake.configure();
    api.airbrake.client.trackDeployment(function(){
      done();
    })
  })
})

from opbeat-node.

watson avatar watson commented on May 13, 2024

@evantahler I've been working on your suggested implementation. Do you expect it to figure out the git rev, branch etc. by it self, or should that be parsed to the trackDeployment() function in the arguments?

If the trackDeployment() method should figure this out by it self it would only work if you deploy using git push because it would need access to the repository

from opbeat-node.

roncohen avatar roncohen commented on May 13, 2024

Hey Thomas. The idea is that the repo is available locally. The method could then take a local path and pull the info from it. It could also optionally take overrides for rev & branch directly.

from opbeat-node.

evantahler avatar evantahler commented on May 13, 2024

+1 to just passing a path (which would default to process.cwd() I imagine). For completeness, I imagine the options and their defaults look something like:

options = {
  path: process.cwd(),
  scm: 'git',
  release: (git sha),
  branch: (git branch),
  time: new Date().getTime() / 1000
}

In the future, other SCMs might be added (svn, hg, etc). Perhaps via plugin. I think @opbeat generally assumes only git deployments currently (as their service requires a link to github.com), so its probably moot for now.

from opbeat-node.

watson avatar watson commented on May 13, 2024

Do you need the timestamp? As far as I know Opbeat doesn't support a timestamp when tracking a deployment... correct me if I'm wrong @roncohen ?

from opbeat-node.

roncohen avatar roncohen commented on May 13, 2024

We actually used to support a plethora of SCMs but everyone we talked to used Git so we ditched the others ;)

For now, we don't support time. I suggest we go ahead without it for now.

from opbeat-node.

watson avatar watson commented on May 13, 2024

@evantahler check out the updated README of the linked pull request and check if this supports your use-case

from opbeat-node.

evantahler avatar evantahler commented on May 13, 2024

looks great!

from opbeat-node.

watson avatar watson commented on May 13, 2024

It's in master now. Please try it out and if everything works as expected I'll release a new version

from opbeat-node.

evantahler avatar evantahler commented on May 13, 2024

It doesn't work for me.

I always get the following error from opbeat's servers:

opbeat: could not notify service.
opbeat: Error: Opbeat error (411): <html>
<head><title>411 Length Required</title></head>
<body bgcolor="white">
<center><h1>411 Length Required</h1></center>
<hr><center>nginx/1.1.19</center>
</body>
</html>

Digging in, we never actually send any deployment information (sha, branch etc). I've commented on the relevant line numbers on commit a4baafe with my thoughts

from opbeat-node.

watson avatar watson commented on May 13, 2024

@evantahler Sorry about the delayed response. I didn't notice your comment because the issue was closed. I've made a fix to master and reopened the issue

from opbeat-node.

watson avatar watson commented on May 13, 2024

Version v1.0 have been released. Check the upgrade guide. I'm considering this one closed. Please open another issue if you need extra functionality :)

from opbeat-node.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.