Thank you, Daniel and Mark. Unfortunately, none of these things are 
documented. At least that I know of.
That's when I actually put sh "ls" in the pipeline script to list. When I 
found my files, I assumed everything is taken care by Jenkins.

Coming to checkout - how can I make out that I checkout the correct branch. 
As everything is happening automatically. I cannot predict what branch name
an user would check-in with. I see that Jenkins itself is checking out the 
branch that has changed.

Regards,
Sharan


On Sunday, 12 February 2017 09:17:10 UTC+5:30, Mark Waite wrote:

> Sharan,
>
> Daniel was trying to tell you that you're misunderstanding what is a 
> workspace and what isn't a workspace.
>
> The place where you're finding the Jenkinsfile is a temporary holding 
> location that exists for the purpose of reading the Jenkinsfile.  It is not 
> a workspace.  It is not a place where you should expect to find the rest of 
> your code.  At the moment, that temporary holding location happens to also 
> include other files, but that is more an accident of the nature of git than 
> it is a capability on which you can rely.
>
> In order to use your source code in a Jenkins pipeline, you need to 
> checkout that source code in one of the early stages of your pipeline.  The 
> examples you've shared don't seem to include a "checkout scm" step, so you 
> have no sources to use.
>
> For examples of the syntax of "checkout scm", you can use the "Pipeline 
> Syntax" hyperlink on the left of pipeline job pages.
>
> Mark Waite
>
> On Sat, Feb 11, 2017 at 7:08 AM Sharan Basappa <[email protected] 
> <javascript:>> wrote:
>
>> Daniel,
>>
>> Don't try to be clever here. `checkout scm`.
>>
>> You are giving me more credit than I deserve. 
>>
>> I really don't understand how source files from Git can appear in the 
>> workspace and .git dir is missing.
>> In fact, for all the source files corresponding to every branch, there is 
>> no .git dir.
>> I have seen this issue only when I started using multibranch pipeline and 
>> not with pipeline or other build job types.
>> Also, in this case alone, I am using Jenkinsfile driven build steps
>>
>>
>> On Saturday, 11 February 2017 15:16:23 UTC+5:30, Daniel Beck wrote:
>>
>>>
>>> > On 11.02.2017, at 05:02, Sharan Basappa <[email protected]> wrote: 
>>> > 
>>> > 3) I am not checking out any repository explicitly in my Jenkinsfile - 
>>> I still find source code in the workspace through 
>>>
>>> That's probably the reason, and the reason it's in a wrong directory. 
>>> Don't try to be clever here. `checkout scm`. 
>>>
>>> -- 
>> 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] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/eebf0cb3-d3ec-4298-bef9-8ed3baa87bb8%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/eebf0cb3-d3ec-4298-bef9-8ed3baa87bb8%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/eb44c5e7-bcc0-4844-9c38-69055ce1b602%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to