I tried withCredentials() method...  its giving an error.. 
NoSuchMethodError...

java.lang.NoSuchMethodError: No such DSL method 'withCredentials' found

 Here is how my method look

withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 
'myid', usernameVariable: 'USERNAME', passwordVariable: 'PASSWORD']]) {

           sh("git tag -a ${TAG_NAME}")
           sh('git push https://${USERNAME}:${PASSWORD}@game-of-life 
--tags')
}

any idea?



On Sunday, June 19, 2016 at 8:30:43 AM UTC-7, Mark Waite wrote:
>
> I found the answer.  Sorry to bother the list.
>
> Git publisher is not yet supported with pipeline (see 
> https://issues.jenkins-ci.org/browse/JENKINS-28335)
>
> A work around to publish to git from a pipeline is available.  See 
> https://github.com/jenkinsci/pipeline-examples/blob/master/pipeline-examples/push-git-repo/pushGitRepo.Groovy
>  
>
> Mark Waite
>
> On Sunday, June 19, 2016 at 9:02:10 AM UTC-6, Mark Waite wrote:
>>
>> I've been creating Jenkins jobs as tests of various bug fixes and storing 
>> them in a git repository.  Currently, the Jenkins jobs include the 
>> definition of the verification steps to confirm the bug is fixed.
>>
>> The pipeline file seems like a better way to check that the problem is 
>> fixed, since the checks for successful job completion can be done in groovy.
>>
>> One of the bugs I need to check needs to use the git publisher to push a 
>> commit back to the originating repository and branch.  In the snippet 
>> generator I can see an entry for "publishHTML", but I don't see any entry 
>> that would let me use the git publisher to push changes.  A google search 
>> also did not show any obvious hints of ways I could use the git publisher.
>>
>> Are there examples that use the git publisher from a pipeline script?
>>
>> Thanks,
>> Mark Waite
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/cd00f7de-6252-41ba-a07e-638e19da0d51%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to