Hi Timur,

good news, loading the CPS script from SCM (i.e. Git or SVN) is one of the 
new features in workflow plugin 1.2. Just add your script to your SCM, 
select "Groovy CPS DSL from SCM" instead of ""Groovy CPS DSL", enter your 
repository, and the name of your Groovy CPS script. 

I did a quick test with Subversion: it works, but I had to experiment a 
while with the settings to make my script work. It looks like Jenkins tries 
to be "smart" about the location of trunk/ in the repository path, which is 
odd, since the repository structure should be none of its business ;-)

I also couldn't figure out what "Local module directory", and "Add module" 
are about. After setting the "Locale module directory", I had to add a "dir 
{ }" instruction. Without that the script started in the wrong directory. I 
guess, that these are Subversion related issues.

/Thomas

On Monday, January 19, 2015 at 11:05:19 AM UTC+1, Timur Batyrshin wrote:
>
> Hi,
>
> I'd like to store the script for running the flow in Git but it looks like 
> I can't do the SCM checkout before running the flow.
> I could write some additional lines in the flow script (one for checkout 
> and one "load" command) but the checkout commands
> are too large in the current state (like:
> checkout changelog: true, poll: true, scm: [$class: 'GitSCM', branches: 
> [[name: 'remotes/origin/master']], userRemoteConfigs: [[credentialsId: 
> 'XXXXXXX-XXXXXX-XXXXX-XXXXXXX', url: '
> https://github.com/XXXXX/XXXXXX.git']]]
> ).
>
> Is there a way to do the initial checkout using plain Jenkins checkout 
> feature or should I use this approach? Probably some other ways of doing 
> that?
>
>
> Thanks,
> Timur
>

-- 
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/9d0c5eb0-ad59-41d1-907a-caa7c95fdfae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to