更新代码
parent
5445cfce08
commit
6863d1e90a
|
|
@ -4,11 +4,25 @@ pipeline {
|
|||
stages {
|
||||
stage('拉最新工程') {
|
||||
steps {
|
||||
// 先给权限
|
||||
sh "chmod +x $WORKSPACE/Tool/dll_tools/*"
|
||||
|
||||
// 使用revert_and_pull_git.sh
|
||||
sh "cd $WORKSPACE/Tool/dll_tools && ./revert_and_pull_git.sh"
|
||||
script {
|
||||
def currentPath = sh(script: 'pwd', returnStdout: true).trim()
|
||||
echo "cd ${currentPath}"
|
||||
|
||||
// 如果仓库存在及还原脚本存在,进行子模块还原
|
||||
def gitDirExists = sh(script: '[ -d ".git" ] && echo "true" || echo "false"', returnStdout: true).trim()
|
||||
def scriptPathExists = fileExists("${WORKSPACE}/Tool/build_tools/git_revert_modules_modification.sh")
|
||||
if (gitDirExists == 'true' && scriptPathExists)
|
||||
{
|
||||
sh "chmod +x $WORKSPACE/Tool/build_tools/git_revert_modules_modification.sh"
|
||||
sh "$WORKSPACE/Tool/build_tools/git_revert_modules_modification.sh $WORKSPACE"
|
||||
}
|
||||
|
||||
def remote = "main";
|
||||
echo "拉取分支:${remote}"
|
||||
checkout scmGit(branches: [[name: "*/${remote}"]],
|
||||
extensions: [checkoutOption(60), lfs(), cloneOption(noTags: false, reference: '', shallow: false, timeout: 120), submodule(recursiveSubmodules: true, reference: '', timeout: 1200)],
|
||||
userRemoteConfigs: [[url: 'http://1.14.122.170:3000/PHXH/NLDClient.git']])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue