Hello again,

Just for the record: I solved it now by putting my jobs under the workflows 
git repo, so in a directory like this: 
"src/com/bla/jobs/BuildApplication.groovy" and then in that script I could 
make a "start()" function and then call that in the job like this:

def task = new com.bla.jobs.BuildApplication()
task.start()

So now it works with the stash git commit hook.
Best regards,
Tom,

On Tuesday, 21 April 2015 09:22:40 UTC+2, Tom Deblauwe wrote:
>
> Hello,
>
> It seems one (not so good) solution is to disable giving the SHA1 to 
> jenkins in the hook on the Stash server that notifies Jenkins. There is an 
> option you can disable so that the SHA1 is not given when triggering the 
> corresponding jenkins job. Not optimal because Stash is not in control 
> anymore about what must be built.
>
> Best regards
> Tom,
>
> On Monday, 20 April 2015 12:47:13 UTC+2, Tom Deblauwe wrote:
>>
>> Hello,
>>
>> I am using the "groovy CPS DSL from SCM" as my configuration for my 
>> workflow. This works well and reads the scripts from my "workflows.git" 
>> reposity. 
>>
>> In the workflow script itself, I start with:
>>
>> node {
>>   git branch: '**', changelog: false, poll: true, url: 
>> 'ssh://git@stash:7999/my/project.git'
>> }
>>
>> I have configured my Stash gitserver to notify Jenkins about a push to my 
>> code repository. In the configuration of my workflow job, I need to enable 
>> "Poll SCM" but without any timings defined for this to work.
>> So the problem is, that I get a notification from Stash with a commit id 
>> from the "project.git" repository(as expected), but jenkins tries to 
>> checkout that commit in the "workflows.git" repository, NOT the 
>> "project.git" repository. It doesn't exist there, so the job fails.
>>
>> So how can I have my workflows scripts in a git repository, and at the 
>> same time use an external trigger to start the build?
>>
>> Best regards,
>> Tom,
>>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/d06e9ef9-81ba-420a-a5ab-b080a38e1116%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to