Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put git branch name in message? #12

Open
tecnobrat opened this issue Feb 20, 2012 · 16 comments
Open

Put git branch name in message? #12

tecnobrat opened this issue Feb 20, 2012 · 16 comments

Comments

@tecnobrat
Copy link

Any way to put the git branch name into the message sent to hipchat?

@rbroemeling
Copy link

I just wanted to add in that we would also find this advantageous. Current messages look like:

[project] - #7 Success after 51 min (Open)

... it would be great if they could be changed to look like:

[project]/[branch] - #7 Success after 51 min (Open)

I checked out the plugin code and the changes look fairly straightforward, however I couldn't figure out where to get the current branch name from the Hudson/Jenkins API, so that has put me at an impasse.

@rocketraman
Copy link
Contributor

+1

@jmcclell
Copy link

It would be nice to be able to configure messages all-together, actually. Maybe some kind of message templating.

@Mange
Copy link

Mange commented Oct 22, 2012

👍

@kmullin
Copy link

kmullin commented Oct 30, 2012

👍 as well.

@tyler-smith
Copy link

I also think this is a good thing.

@kmullin
Copy link

kmullin commented Nov 1, 2012

Ok, so I took a stab at this. I found two approaches:

  1. Look at ChangeLogSet to see if entries, read commitId(Msg,Author) from last entry in changes
    changes: https://github.com/uservoice/jenkins-hipchat-plugin/compare/add_commit_hash
  2. HACK: basically grep build log for specific string to match branch and SHA1 hash
    heavily relies on a very short buildLog (< 100 lines)
    also there are specific hard codings for us in there
    changes: https://github.com/uservoice/jenkins-hipchat-plugin/compare/uservoice_hacks

I also looked into trying to use hudson.scm.SCM, but I couldn't figure out how to expose SCM related info... maybe someone more knowledgeable could help solve that.

These changes were branched from hipchat-0.1.4 release because it was the only known working version that we'd already been using.

@kscaldef
Copy link

Yes, message templating similar to email notifications would be really useful. For our parameterized builds, it would be much more useful to be able to include some of the parameters in the notification.

@colszowka
Copy link

➕ 1️⃣

@marcins
Copy link

marcins commented Feb 8, 2013

Vote for having a per-project message template too. My use case is that I have a project with a parameter that determines whether to deploy to staging or production and in HipChat there's no way to tell which kind of build was run.

@marcins
Copy link

marcins commented Feb 9, 2013

If anyone wants to try the plugin with Mustache notification templates I have a snapshot HPI up in Dropbox:

https://dl.dropbox.com/u/5336861/hipchat.hpi

YMMV, disclaimer, etc, etc :-)

Also check the updated README

@marcins
Copy link

marcins commented Feb 10, 2013

FYI - It appears that the git plugin sets an environment variable GIT_BRANCH based on which branch is being built, so with the Mustache template you can output {{build.environment.GIT_BRANCH}}.

@borkdude
Copy link

+1

3 similar comments
@JustinAiken
Copy link

👍

@tokyowizard
Copy link

+1

@dennisbaskin
Copy link

+1

Palmr pushed a commit to Palmr/jenkins-hipchat-plugin that referenced this issue May 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests