// checkout sources for building
checkout scm
//checkout configuration for TEST environment
checkout scm (config)
--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0aa76f95-1c3c-43bb-a3a7-01b45a3eb282%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
// checkout repo1 (origin)
checkout([$class: 'GitSCM', branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false, extensions: [[$class:
'RelativeTargetDirectory', relativeTargetDir: 'origin']], gitTool:
'Default', submoduleCfg: [], userRemoteConfigs: [[credentialsId:
'Bitbucket_Access', name: 'origin', url:
'ssh://g...@server01.mycompany.net:7999/path/to/repo1.git']]])
// checkout repo1-config (origin-config)
checkout([$class: 'GitSCM', branches: [[name: '*/master']],
doGenerateSubmoduleConfigurations: false, extensions: [[$class:
'RelativeTargetDirectory', relativeTargetDir: 'origin-config']], gitTool:
'Default', submoduleCfg: [], userRemoteConfigs: [[credentialsId:
'Bitbucket_Access', name: 'origin', url:
'ssh://g...@server01.mycompany.net:7999/path/to/repo1-config.git']]])
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 jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a692a6fb-a34f-4f14-8354-1cf9387ef98a%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2a739f96-545e-4d46-a4d3-90aaeecec99a%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/2a739f96-545e-4d46-a4d3-90aaeecec99a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPzcO4gAHi_i3O%3DnpjPCffXBJ-0Z1TJsxnKEO7ea1vvrtnAEpA%40mail.gmail.com.
checkout([$class: 'GitSCM', branches: [[name: "${gitBranch}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', timeout: 120]], submoduleCfg: [], userRemoteConfigs: [
[credentialsId: "${credentialsId}", url: "${mainProjectGITURL}"],
[credentialsId: "${credentialsId}", url: "${list[0]}"],
[credentialsId: "${credentialsId}", url: "${list[1]}"],
[credentialsId: "${credentialsId}", url: "${list[2]}"],
[credentialsId: "${credentialsId}", url: "${list[3]}"]
]])
I know this is fairly old thread but I have an issuewhen using the multi repo checkout it seems to remove the previous repo checkout before doing the new one.I have tried checking all the repos required for my build using the Jenkins Declarative "checkout" commandWith this config I can see on my build server each project are being checked out but only the last project is availbale after this checkout.
checkout([$class: 'GitSCM', branches: [[name: "${gitBranch}"]], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CloneOption', timeout: 120]], submoduleCfg: [], userRemoteConfigs: [
[credentialsId: "${credentialsId}", url: "${mainProjectGITURL}"],
[credentialsId: "${credentialsId}", url: "${list[0]}"],
[credentialsId: "${credentialsId}", url: "${list[1]}"],
[credentialsId: "${credentialsId}", url: "${list[2]}"],
[credentialsId: "${credentialsId}", url: "${list[3]}"]
]])
I also tried doing in a loop using "git" onlydef list = "${includedProjectsGITURLS}".split("\n")
echo "Number of repos : " + list.size()
echo "Checking out main project (${gitBranch}) : " + mainProjectGITURL + "\n";
git credentialsId: 'blablabla', url: "${mainProjectGITURL}"
for (String gitSubURL:list)
{
echo "Checking out sub project (${gitBranch}) : " + gitSubURL + "\n";
git credentialsId: 'blablabla', url: "${gitSubURL}"
}
The result is the same, making me think "checkout" is just wrapper for GIT
I also tried checking each repo into its own sub folder but the result is the same
any ideas how I can checkout multiple repos in Jenkins declarative script for single build
On Wednesday, December 21, 2016 at 7:25:43 PM UTC+2, Torsten Reinhard wrote:Hi,
I have a pipeline doing a build and afterwards a deployment to the TEST environment.
For the build I need to
// checkout sources for building
checkout scm
and later on I need to
//checkout configuration for TEST environment
checkout scm (config)
I wasn´t able to configure a working directory for each repo - and the "Multiple SCMs plugin" is deprecated with a hint to the Pipeline plugin.
How can I setup the Pipeline job so it´s using "Pipeline script from SCM" AND additionally some files/configs from a different repo?
I know about the workaround with subtrees and also this issue: https://issues.jenkins-ci.org/browse/JENKINS-13228,
but I´m wondering why help points to the Pipeline plugin ?
Any sample setup available ?
Thanx for helping,
Torsten
--
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-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/0d41e558-853d-4cbc-8b8f-fbcdfffedb57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/a3a16754-74b5-4022-88ea-eb9e0ac19555n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAGJXh7o_iovEq2jqrA2f3dW7ajtansTJ7iW%3D8CtmvpnLExxBCg%40mail.gmail.com.
Not sure you can put the if before the whole stage (I’m using scripted pipeline, not declared one du to limitation). but Having stage that appear or disappear make the GUI stage display do weird think into scripted pipeline for the job table. I often just skip the inner content of the steps and display a trace into the console to keep a trace the step was skipped, anyway the build time for that step will be nearly 0ms.
steps {
if(gitBranch != ‘re-5.1’) {
… do your step code here
}
}
This way the job display may stay the same when skipping or not the steps.
Might not be what you want, just throwing an idea here.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CA%2BfgoYc%2Bky%3D7u%2BxCTSCyPZT1SL7Odg%3D%3DzZF3_a71OLibpDhY3w%40mail.gmail.com.