Giter VIP home page Giter VIP logo

flowdock-plugin's Introduction

Flowdock Plugin for Jenkins

Flowdock Plugin is a tool for sending build notification from Jenkins to your flow. It hooks to Post-build Actions of the build, so you can use with any number of different builds. All you need to configure is the API token of the flow where you want the notifications to go. See Tokens page for list of your API tokens.

Install

With Jenkins Plugin manager

  • Go to Manage Jenkins -> Manage Plugins -> Available
  • Find "Flowdock plugin" and install it
  • Restart Jenkins

From Jenkins Plugin repository

  • Download the latest plugin
  • Install it by uploading the package in admin: Manage Jenkins/Hudson -> Manage Plugins -> Advanced -> Upload Plugin
  • Restart Jenkins/Hudson

From source

To compile this plugin from source, you need to have at Maven 3.0.4 or newer installed.

  • Clone the Github repo
  • Run mvn install to build a .hpi-plugin package
  • Install it by uploading the package in admin: Manage Jenkins/Hudson -> Manage Plugins -> Advanced -> Upload Plugin
  • Restart Jenkins/Hudson

Configure

  • Go to Configure page inside a build
  • Scroll down to Post-build Actions
  • Select "Flowdock notification" from the list and fill out your the API token of your flow
  • Save the changes and click "Build Now"
  • Your flow should now receive notification. If not, see the Console Output of the build for errors.

Troubleshooting

If Flowdock plugin stops working after upgrading, the likely cause is old configuration data that may remain and cause exceptions. The quickest way to resolve this is to re-install the Flowdock plugin, which should flush the cached configuration.

Common errors in console output

Flowdock: failed to send notification
Flowdock: response status: 401 Unauthorized

Most likely the API token is not valid or you do not have the permission to access the flow.

Flowdock: failed to send notification
Flowdock: response status: 400 Bad Request, _RESPONSE_

Validation of the notification message failed. This can occur when customizing the build notification content as it needs to conform to Flowdock Push API format described in the API documentation. The RESPONSE text should help in debugging why the message was rejected.

Write your own custom notifier

It's easy, just fork the Github repo of Jenkins Flowdock Plugin and start hacking!

To simply modify the contents of Team Inbox or Chat messages sent by the plugin, see the fromBuild method in TeamInboxMessage and ChatMessage classes.

Jenkins Flowdock Plugin contains a full implementation of the Flowdock Push API which is great for posting notifications. If you need to go beyond simple notifications, have a look at what the REST API can offer you.

flowdock-plugin's People

Contributors

arcivanov avatar batmat avatar elithompson avatar jimlar avatar jstaffans avatar lautis avatar osqu avatar tjokimie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flowdock-plugin's Issues

Name flowdock API-keys with friendly name globally

Would it be possible to define flowdock API-keys on a global level in flowdock? This would greatly aid when setting up and maintaining messages across many builds.

We have 40+ builds and 15-20 flowdock rooms spead across our teams. This would greatly aid whn "debugging" where messages are being sent by seeing "team board" instead of the API-key.

An alternative would be to have a UI on the global level where you could specify which builds post to flowdock, where and with which configuration

NPE if user has configured an invalid email in git

Given a commit with author foo <@>, the Flowdock plugin crashes when gathering author info for the message:

FATAL: 0
java.lang.ArrayIndexOutOfBoundsException: 0
    at hudson.plugins.git.GitChangeSet.findOrCreateUser(GitChangeSet.java:291)
    at hudson.plugins.git.GitChangeSet.getAuthor(GitChangeSet.java:349)
    at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:350)
    at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:346)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:672)
    at hudson.model.Run.execute(Run.java:1763)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)

Should accept spaces after commas in notification tags

We were wondering why the following wouldn't work, as only #jenkins appeared in tags.

screen shot 2015-07-29 at 11 50 19

So the tags literally have to be just comma-separated, like jenkins,develop,$Site. Not a big deal but looks like comma-and-space separated values are quite common in Jenkins, so I think it's easy to get this wrong.

Multi-configuration project shows label name in chat i.o. project name

When using a multi-configuration project the Flowdock plugin uses the projects label name for display instead of the actual project name.

Example:

  • Project test-project has a multi-configuration setup with the label testing and two assigned nodes, one and two.
  • After the build runs, Jenkins will report in the team inbox testing=one build X was successful and testing=two build X was successful.
  • After a failed build, Jenkins will report in the flow testing=one build X failed.

I would expect messages in the style of:

  • test-project build X on testing=one was succesful
  • test-project build X on testing=one failed

Html escape commit messages

When creating the list of commits for Flowdock messages, they commit messages might contain text that's considered a html tag. These get either converted to actual html or stripped when sanitizing, both of which are unwanted outcomes. The commit messages should be html escaped before being added to the Flowdock message.

Flowdock default config should not select success by default

Because of https://github.com/jenkinsci/flowdock-plugin/blob/master/src/main/resources/com/flowdock/jenkins/FlowdockNotifier/config.jelly#L25 Flowdock notifier will by default notify when build is successful.

IMO, this is a bad idea both in term of general CI where you should consider success is the normal way, and only 'react' when something changes (say, fails). In the Flowdock specific case, like in emails btw, it results in flooding the flow inbox with "success" messages. And failure can easily go unseen.

Please change that behaviour. If you agree with the rationale above (i.e. reducing the noise), I can issue a PR very soon.

Thanks a lot

Add support for variable expansion in tags

I thought it would work out of the box but it isn't. I have parametrised builds and the build name doesn't say everything about it so I'd like to tag it with the build parameters, but they aren't expanded in the messages. Would be nice to have it.

DSL integration issue

I have latest flowdock plugin and I tried to create a DSL with below combinations for this and I get error : java.lang.NoSuchMethodError: No such DSL method 'flowdock' found among steps
Example 1:
flowdock('flow-token') {
unstable()
success()
aborted()
failure()
fixed()
notBuilt()
}
Example 2:

publishers {
    flowdock('a-flow-token')
}

}

Cloning, Hacking, Releasing

Hi,
You mention in the Readme that I can clone, hack and release my own version of this plugin.
What I would like to achieve is to send the line in the job that states FAILURE: and the reason to the chat window.
Can you advise how I could do this please?

Regards
githubble

Maintain a thread for all posts of one build

One of Flowdock's great features is the threads. It'd be natural and useful to get all messages for a particular build into the same thread.

I think it only requires some mapping of build to thread, if no thread exists, then a normal message is sent, its thread ID (which I'm assuming is returned by the Flowdock API) is stored, otherwise the thread ID found is used for the message.

Setup different messages per flow

At the moment it's possible to send messages to seperate flows, but not possible to specify which types of message go to which flow.

Also it's not possible to add mutiple Flowdock-steps, so I can't add seperate configs per flow.

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.