-
Notifications
You must be signed in to change notification settings - Fork 129
Add support for Jenkins Pipeline. #110
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
Conversation
Before this commit, if you attempted to use the Stash pull-request builder plug in with Jenkins Pipeline, you would encounter an error. Ultimately, this error was due to the fact that this plug in require jobs to use the AbstractProject base class, but the Jenkins Pipeline job class (WorkflowJob) doesn't. The good news is that WorkflowJob and AbstractProject share a base class of Job, and that most functionality of this plug in can be made available to WorkflowJob refactoring uses of AbstractProject to uses of Job instead. For cases where this does not provide enough functionality, there are interfaces implemented in common by both (ParameterizedJobMixIn.ParameterizedJob, Queue.Task) that fill the gaps. The one remaining piece of functionality this commit does not extend to be available to Jenkins Pipeline is custom post-build comments, so a TODO to that effect was added.
Can we get a release for this? |
HI, When it can be released? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Hi, Can we get a release of this.. with support for pipeline ? |
Is there a reason this hasn't been released? @nemccarthy |
@stebadge Do you mind sharing a sample jenkinsfile using this plugin? It will be useful for others too . I will add the details to the ReadMe once i have it working. |
It's not really about the jenkins file @praveen12bnitt . You can use any jenkinsFile you please. |
I ended up taking the fixes, building them locally and then installing it to my jenkins box manually, as many others mentioned above. It seems to work great for me. I'd prefer to use hooks, but, I haven't the allotted time to upgrade the plugin. |
@stebadge @bcfisher Can you share how you used this in pipeline? I'm trying to use it in the properties step in pipelineTrigger as the pipeline code generator syntax states, but I'm getting an error: Caused: java.lang.IllegalArgumentException: Could not instantiate {triggers={$class=StashBuildTrigger, projectPath=, cron=* * * * *, stashHost=xxxxxxxxxx, credentialsId=xxxxxxxxxxxx, projectCode=xxxxxxxx, repositoryName=env.GIT_URL, ciSkipPhrases=NO TEST, ciBuildPhrases=test this please, ignoreSsl=false, checkDestinationCommit=false, checkMergeable=false, mergeOnSuccess=false, checkNotConflicted=false, onlyBuildOnComment=false, deletePreviousBuildFinishComments=false, cancelOutdatedJobsEnabled=false}} ... This is the code I have in properties pipelineTriggers([stashBuildTrigger(projectPath: '', cron: '* * * * ', stashHost: xxxxx', credentialsId: 'xxxxxxxx', projectCode: 'xxxxx' /"${project_name}"*/, repositoryName: 'env.GIT_URL', ciSkipPhrases: 'NO TEST', ciBuildPhrases: 'test this please', ignoreSsl: false, checkDestinationCommit: false, checkMergeable: false, mergeOnSuccess: false, checkNotConflicted: false, onlyBuildOnComment: false, deletePreviousBuildFinishComments: false, |
I didn't add it to the jenkinsFile, but instead, from the ui. |
@bcfisher |
Had any one run the latest version of master successfully ? Looking for
release that supports pipeline.
|
@kikuingithub yeah it works. But it doesn't work with the multibranch pipeline job. I switched over to pipeline job but I still need regular branches to build and so far I have not been able to get the job to work to build both PRs and branches. If anyone has any insight let me know. |
Anybody else having problems aborting running pipeline jobs? To be clear, we run the non-released version of the plug-in, in which pipeline jobs are supported. |
Was this released yet as an official version? If not, is there a planned date? |
I have submitted a PR for the current code, please see jenkinsci#69 |
Before this commit, if you attempted to use the Stash pull-request
builder plug in with Jenkins Pipeline, you would encounter an error.
Ultimately, this error was due to the fact that this plug in require
jobs to use the AbstractProject base class, but the Jenkins Pipeline
job class (WorkflowJob) doesn't.
The good news is that WorkflowJob and AbstractProject share a base
class of Job, and that most functionality of this plug in can be made
available to WorkflowJob refactoring uses of AbstractProject to uses
of Job instead. For cases where this does not provide enough
functionality, there are interfaces implemented in common by both
(ParameterizedJobMixIn.ParameterizedJob, Queue.Task) that fill the
gaps.
The one remaining piece of functionality this commit does not extend
to be available to Jenkins Pipeline is custom post-build comments, so
a TODO to that effect was added.