Git Product home page Git Product logo

Comments (20)

DavidTanner avatar DavidTanner commented on July 21, 2024

I think you would want to use the GitHub plugin to do that. You can also append a portion of the build logs to the comment that gets made when the job fails.
https://wiki.jenkins-ci.org/display/JENKINS/GitHub+Plugin
http://stackoverflow.com/questions/14274293/show-current-state-of-jenkins-build-on-github-repo/26910986#26910986

from ghprb-plugin.

DavidTanner avatar DavidTanner commented on July 21, 2024

It looks like that will just give you the status, not a custom message.
The plugin is set up to use extensions now, so you are welcome to add one that will do just what you want, and add it to the extensions.status package.

from ghprb-plugin.

jsquyres avatar jsquyres commented on July 21, 2024

I'm sorry, I don't think I was clear. I was specifically referring to the "Details" link at the bottom of GH PRs. That link is being set to the URL of our internal Jenkins server.

Specifically, I'd like to provide a per-job value for the target_url in the JSON that is being sent back by GHPRB to set the commit status (i.e., the gist URL that I generate during my job build steps).

from ghprb-plugin.

DavidTanner avatar DavidTanner commented on July 21, 2024

I am pretty sure we are on the same page. The status update is what sets that details link, or the icon to the right of the commit. Right now it is just set to use the internal url, but an extension would allow that to change to whatever you want.

from ghprb-plugin.

jsquyres avatar jsquyres commented on July 21, 2024

Ah, ok.

Any suggestions for how I would do that in an extension? (forgive me; I'm unfamiliar with the GHPRB extensions...) Is there a "usual" way for a child process to pass some info back up to Jenkins (other than the exit status of the build script)?

from ghprb-plugin.

DavidTanner avatar DavidTanner commented on July 21, 2024

Use this file as a starting point. You just have to handle updating the status when the build is scheduled, starting, and complete.
https://github.com/jenkinsci/ghprb-plugin/blob/ghprb-1.23.2/src/main/java/org/jenkinsci/plugins/ghprb/extensions/status/GhprbSimpleStatus.java

from ghprb-plugin.

jsquyres avatar jsquyres commented on July 21, 2024

Ok, we'll have a look at that. Thanks!

from ghprb-plugin.

DavidTanner avatar DavidTanner commented on July 21, 2024

I think I will just add it to #103 since it hasn't been merged yet.

from ghprb-plugin.

jsquyres avatar jsquyres commented on July 21, 2024

Sweet; thank you!

Do you have a guesstimate on when this will be in a published release of GHPRB?

from ghprb-plugin.

DavidTanner avatar DavidTanner commented on July 21, 2024

The changes landed in build 1.24 and will be in the update center within the next few hours, whenever their process runs next.

from ghprb-plugin.

jsquyres avatar jsquyres commented on July 21, 2024

I've updated my Jenkins to use 1.24 of GHPRB and I'm a little confused at to how to do what I want.

Forgive me -- I might have used the wrong terminology to define what I want to do. I see this screenshot:

jenkins-ghprb-status-update-1 24

I think I said "job" earlier in this issue when I really should have said "build". I.e., I have build-specific output that I want to include in the details/status link on github (in this case, I dump my build log to a gist that is specific to that build).

from ghprb-plugin.

DavidTanner avatar DavidTanner commented on July 21, 2024

The "Commit Status URL" will be resolved when the plugin updates the status of a commit. If you put an environment variable in there then it will be resolved during the build

from ghprb-plugin.

jsquyres avatar jsquyres commented on July 21, 2024

How do I set an environment variable from my build steps (potentially executing on a separate slave node) that the GHPRB plugin will see?

from ghprb-plugin.

DavidTanner avatar DavidTanner commented on July 21, 2024

I recommend using https://wiki.jenkins-ci.org/display/JENKINS/EnvInject+Plugin, then you can inject variables at any stage of the build using a properties file, a properties script, a groovy script, or a groovy file.

from ghprb-plugin.

jsquyres avatar jsquyres commented on July 21, 2024

Sweet. Let me go check that out.

(many thanks for your patience and all the help!)

from ghprb-plugin.

hppritcha avatar hppritcha commented on July 21, 2024

I'm checking how to use the Commit Status URL box in the GHPRB global configure section.
It doesn't seem to have any impact on the link pointed to by details. Do I need to supply values for
the other two fields - Commit Status Build Triggered and Commit Status BuildStarted?

from ghprb-plugin.

DavidTanner avatar DavidTanner commented on July 21, 2024

So it looks like I forgot to add the getter for the field, so the configure page won't show the url you saved. I just fixed it locally and will release a patch, but the functionality should still work.

DavidTanner/Testing#12
Currently the last status details is for google.com, which is what I saved in the config.

from ghprb-plugin.

jeevandev avatar jeevandev commented on July 21, 2024

@jsquyres I want do the same thing as you have done, pushing our jenkins(behind firewall) console logs to a gist & then publishing it using custom url. I have figured the custom url part but i am not sure how should i push the console logs to gist. It would be great if you can let me know how you did that. Thank you

from ghprb-plugin.

jsquyres avatar jsquyres commented on July 21, 2024

@jeevandev We just use a CLI gist uploader -- https://github.com/defunkt/gist.

from ghprb-plugin.

jeevandev avatar jeevandev commented on July 21, 2024

@jsquyres perfect thanks, i was trying to do it using groovy & bash

from ghprb-plugin.

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.