the Jenkinsfile detection indeed relies on a git clone on master, but this
isn't considered a workspace. Also, it might not be necessary for some
integrations, typically one could access this specific file remotely (not
sure about the actual implementation)

To get the exact commit that triggered a build, your Jenkinsfile should
look like :

node() {
   checkout scm
   ...
}



2016-12-05 9:30 GMT+01:00 Christoph Nenning <[email protected]>:

> Hi,
>
>
> > Where do you put this ws step ?
>
> You can put it at the beginning of your Jenkinsfile
>
>
> > My concern is how to benefit from the SCM schedule and checkout
> > phase made to retrieve the so called jenkinsfile, i.e. the script
> > (and possible libraries) that is executed to run the pipeline.
>
> AFAIK you cannot use the workspace that jenkins creates to checkout
> Jenkinsfile.
>
> But you can checkout the same repo (or other polled SCM URLs) with this
> command:
>
> checkout scm
>
>
> Regards,
> Christoph
>
>
>
> > From: Jean-Luc Pinardon <[email protected]>
> > To: [email protected],
> > Date: 05.12.2016 09 <05%2012%2020%2016%2009>:05
> > Subject: Re: Jenkins Pipeline : How could I access the git
> > repository cloned at job start
> > Sent by: [email protected]
> >
> > Hello,
> >
> > Thanks for your answer.
> > But I am not sure to understand.
> > Where do you put this ws step ?
> > I am not sure to have been clear enough.
> > My concern is how to benefit from the SCM schedule and checkout
> > phase made to retrieve the so called jenkinsfile, i.e. the script
> > (and possible libraries) that is executed to run the pipeline.
> >
> > 2016-12-03 7:37 GMT+01:00 Sam K <[email protected]>:
> > I just use a ws('<some predetermined space>') {
> >    git url:..... , branch: 'master'
> > }
> >
> > and now all the cloned content is within the directory I want.
> >
> > On Tuesday, November 29, 2016 at 1:14:03 AM UTC-8, Jean-Luc Pinardon
> wrote:
> > Dear all,
> >
> > I am exploring pipeline features, and I fall into a problem.
> > The repository is indeed correctly cloned at job start and the
> > "jenkinsfile" is run.
> > But I "discover" that I cannot access the cloned files from within
> > the stages within nodes. Just because, the workspace used at job
> > begin is certainly not the same as the workspace within the nodes.
> >
> > So, my question is : is there a way to make available the initially
> > cloned files all over the pipeline, or should I clone the repository
> > once more within the first stage and then stash the files I need.
> >
> > Thanks for your help.
> > J.L.P.
> > --
> > You received this message because you are subscribed to a topic in
> > the Google Groups "Jenkins Users" group.
> > To unsubscribe from this topic, visit https://groups.google.com/d/
> > topic/jenkinsci-users/qzBWmFHOmoI/unsubscribe.
> > To unsubscribe from this group and all its topics, send an email to
> > [email protected].
> > To view this discussion on the web visit https://groups.google.com/
> > d/msgid/jenkinsci-users/aca57995-52c2-42f6-94aa-5cee7e434b29%
> > 40googlegroups.com.
> >
> > 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/CALijN65Q_TE2zj5NhwJpoi5%2BW3jX-
> > vVXds0QVJrXO4iKs72Wkw%40mail.gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
>
>
> This Email was scanned by Sophos Anti Virus
>
> --
> 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/OFE7E55BA0.1AC16254-ONC1258080.002E9363-C1258080.
> 002EBDB0%40lex-com.net
> <https://groups.google.com/d/msgid/jenkinsci-users/OFE7E55BA0.1AC16254-ONC1258080.002E9363-C1258080.002EBDB0%40lex-com.net?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/CANMVJzmgh7jBd%2B6JbL_16J5TsnsAMpDmOiEX4WkK6vmqzfoWUQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to