-
Notifications
You must be signed in to change notification settings - Fork 651
Support Jenkins CI #313
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
Comments
Based on a quick search. Maybe something like this would work: https://wiki.jenkins-ci.org/display/JENKINS/Environment+Script+Plugin From http://stackoverflow.com/questions/12924232/set-jenkins-prompt-variables-using-a-scripts-output |
I have not received any replies to my question on the Jenkins group. From my research thus far I concluded that this can only be achieved using an additional Jenkins plugin (e.g. the one you suggested). Do you guys mind tying users to a specific Jenkins plugin? (I don't really mind - in a sense it appears to be the Jenkins way of things) |
@JakeGinnivan: Do you guys mind tying users to a specific Jenkins plugin? (I don't really mind - in a sense it appears to be the Jenkins way of things) |
Depending on how different the plugins are, we could pick the top two, pick a default then make it a config option to switch between. Completely up to you though. I don't mind tying to a single plugin. |
Note to self: check out to a specific branch, because gitversion requires a current branch and jenkins default behavior is building in detached head mode. |
@serra Has there been progress on this? Any chance of getting this into the next release? |
@pvandervelde no progress thusfar; since Jenkins does not have a concept similar to Service Messages, this would mean a fundamentally different implementations than the current TeamCity and similar implementations. I guess I could cook up a (IMO) hackish implementation similar to the current
Best integration with Jenkins would be to be able to do something like:
Which could then be injected into Jenkins using the EnvInject plugin. |
That's roughly what I'm doing currently. The main issue is that GitVersion behaves differently if it thinks it's on a build server than when it's on a dev machine. It normalizes branches on the build machine and not on the dev machine (as far as I know). The problem I have with Jenkins is that Jenkins doesn't pull all the history, just the commit and it doesn't even put that commit on a proper branch (uses a detached head instead) which stuffs up GitVersion. |
#507 could help with this. It would also be good to get the current approaches documented. Would either of you be up for submitting a PR with some info on setting up jenkins at https://github.com/GitTools/GitVersion/blob/master/docs/more-info/build-server-setup/jenkins.md ? |
I can probably have a look at the configuration we use at work when I'm back there next week. Mind you I haven't found a good setup to get the branch names to work out yet. |
@JakeGinnivan would you accept a PR for
writes out
That output would be trivial to use with the EnvInject plugin. |
Or do you prefer a Jenkins I prefer the |
Note to self A suitable jenkins implementation might be one that saves the |
Fixed with merge of PR #551 |
See the comment thread in #288.
I'll see if I can get something to work in my environment. I'll open a PR then.
JENKINS_URL
to confirm that we're running from within the context of a job in Jenkins. See wiki/Command-Line-Tool#directly-on-build-serverCurrent implementations write a message to the build output. This message should then be picked up by the build server. In Team City, this concept is called Service Messages.
AFAIK a similar concept is not available in Jenkins CI, which would mean the Jenkins implementation would be conceptually different. Before picking this up, I'll wait for some answers to my post to the Jenkins newsgroup.
Todo
There does not appear to be a similar concept to service message in Jenkins. There are however several Jenkins plugins that add similar functionality to Jenkins, e.g. environment script plugin mentioned in the comments thread. We require use of this (or similar) plugin:
/buildserver
with tests for Jenkins CIThe text was updated successfully, but these errors were encountered: