Jenkins清空当前Clean Workspace
使用deleteDir()stage("Clean Workspace ") {steps{sh("ls -al ${env.WORKSPACE}")deleteDir()// clean up current work directorysh("ls -al ${env.WORKSPACE}")}}完整pipelinepipeline {agent anyoptions{timestamps (
·
使用deleteDir()
stage("Clean Workspace ") {
steps{
sh("ls -al ${env.WORKSPACE}")
deleteDir() // clean up current work directory
sh("ls -al ${env.WORKSPACE}")
}
}
完整pipeline
pipeline {
agent any
options{ timestamps () }
stages {
stage('get code ') {
steps {
sh("ls -al ${env.WORKSPACE}")
deleteDir() // clean up current work directory
sh("ls -al ${env.WORKSPACE}")
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'git@JBr.com:front/DFCc.git']]])
}
}
}
}
更多推荐
已为社区贡献3条内容
所有评论(0)