0
是否有可能將一組隱藏的工件作爲扁平目錄進行拆分,就像您可以使用jenkins存檔一樣?詹金斯工作流程存放扁平化文件夾
我希望它有3個文件夾隱藏,只有一個與3的所有內容不沾,但我目前無法完成。
這裏是我的嘗試:
echo("Workflow Starting...");
node {
def imageNames = ["connector","registryloader","salepersistence","settlement","standalone","trackingloader"]
stage 'Building
checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[credentialsId: '36c9ca9f-de25-4022-b9eb-70ada8e793b8', depthOption: 'infinity', ignoreExternalsOption: true, local: '.', remote: 'http://10.64.111.28/svn/SampleProject/skl-br']], workspaceUpdater: [$class: 'UpdateUpdater']])
withEnv(["PATH+MAVEN=${tool 'M3'}/bin"]) {
bat "mvn clean install assembly:assembly versions:resolve-ranges -Dmaven.test.skip=false -DskipTests"
}
echo("Archiving")
archive '**/target/*.tar.gz, conf/desenv/**/*'
for(int i = 0; i < imageNames.size(); i++){
String imageName = imageNames[i]
echo("Stashing ${imageName}")
stash excludes: '', includes: '**/sklbr-1.0.0-standalone.tar.gz, **/'+imageName+'/*, **/commonConfigs/*, **/scripts/*', name: ''+imageName+''
}
stage 'Creating Container'
docker.withServer('tcp://localhost:2375')
{
for(int i = 0; i < imageNames.size(); i++){
String imageName = imageNames[i]
ws('sub-workspace ' + imageName) {
echo("Creating ${imageName} container")
//unarchive mapping: ['**/sklbr-1.0.0-standalone.tar.gz' : '.', '**/${imageName}/*' : '.', '**/commonConfigs/*' : '.', '**/scripts/*' : '.']
unstash imageName
echo("Unstashing ${imageName}")
def newApp = docker.build "devops-docker-registry:5000/"+imageName+":${env.BUILD_NUMBER}-${env.SVN_REVISION}"
echo("Building container with ${imageName}")
newApp.push()
echo("Pushing ${imageName} container")
}
}
}
}
謝謝,我會研究它。 –