更新代码

main
刘涛 2025-04-30 16:28:11 +08:00
parent 5445cfce08
commit 6863d1e90a
1 changed files with 19 additions and 5 deletions

View File

@ -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']])
}
}
}