Commit 2ae80615 authored by Auto Backup's avatar Auto Backup

refactor: 移除git检测,因为Jenkins会在更早阶段检查git

parent 4cbcd50e
...@@ -71,9 +71,8 @@ pipeline { ...@@ -71,9 +71,8 @@ pipeline {
} catch (Exception e) { } catch (Exception e) {
echo "环境排查阶段发生错误: ${e.message}" echo "环境排查阶段发生错误: ${e.message}"
echo "⚠️ 环境检测失败,请确保以下组件已安装:" echo "⚠️ 环境检测失败,请确保以下组件已安装:"
echo "1. Git (https://git-scm.com/downloads)" echo "1. Node.js (https://nodejs.org/)"
echo "2. Node.js (https://nodejs.org/)" echo "2. ss3ops (会自动安装,如失败请手动安装)"
echo "3. ss3ops (会自动安装,如失败请手动安装)"
currentBuild.result = 'FAILURE' currentBuild.result = 'FAILURE'
error("环境检测失败: ${e.message}") error("环境检测失败: ${e.message}")
} }
......
...@@ -31,41 +31,6 @@ async function executeCommand(command) { ...@@ -31,41 +31,6 @@ async function executeCommand(command) {
} }
} }
/**
* Check if git is installed
*/
async function checkGit() {
console.log('🔍 Checking Git installation...');
// Try git --version
const result = await executeCommand('git --version');
if (result.success) {
console.log(`✅ Git is installed: ${result.stdout}`);
return true;
} else {
console.log('❌ Git is not installed or not in PATH');
// For Windows, try common git paths
if (isWindows) {
const commonPaths = [
'C:\\Program Files\\Git\\bin\\git.exe',
'C:\\Program Files (x86)\\Git\\bin\\git.exe',
'D:\\Git\\bin\\git.exe'
];
for (const path of commonPaths) {
if (fs.existsSync(path)) {
console.log(`✅ Git found at: ${path}`);
return true;
}
}
}
return false;
}
}
/** /**
* Check if Node.js is installed * Check if Node.js is installed
*/ */
...@@ -200,15 +165,6 @@ async function main() { ...@@ -200,15 +165,6 @@ async function main() {
let allChecksPassed = true; let allChecksPassed = true;
// Check Git
const gitInstalled = await checkGit();
if (!gitInstalled) {
console.log('⚠️ Git is required for this environment');
allChecksPassed = false;
}
console.log();
// Check Node.js // Check Node.js
const nodeInstalled = await checkNode(); const nodeInstalled = await checkNode();
if (!nodeInstalled) { if (!nodeInstalled) {
...@@ -245,7 +201,6 @@ async function main() { ...@@ -245,7 +201,6 @@ async function main() {
} else { } else {
console.log('❌ Some environment checks failed'); console.log('❌ Some environment checks failed');
console.log('\nPlease install the missing components:'); console.log('\nPlease install the missing components:');
if (!gitInstalled) console.log('- Git: https://git-scm.com/downloads');
if (!nodeInstalled) console.log('- Node.js: https://nodejs.org/'); if (!nodeInstalled) console.log('- Node.js: https://nodejs.org/');
process.exit(1); process.exit(1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment