Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
cpas6-install
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李金钢
cpas6-install
Commits
2ae80615
Commit
2ae80615
authored
Mar 19, 2026
by
Auto Backup
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor: 移除git检测,因为Jenkins会在更早阶段检查git
parent
4cbcd50e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
48 deletions
+2
-48
Jenkinsfile
Jenkinsfile
+2
-3
check-environment.js
check-environment.js
+0
-45
No files found.
Jenkinsfile
View file @
2ae80615
...
...
@@ -71,9 +71,8 @@ pipeline {
}
catch
(
Exception
e
)
{
echo
"环境排查阶段发生错误: ${e.message}"
echo
"⚠️ 环境检测失败,请确保以下组件已安装:"
echo
"1. Git (https://git-scm.com/downloads)"
echo
"2. Node.js (https://nodejs.org/)"
echo
"3. ss3ops (会自动安装,如失败请手动安装)"
echo
"1. Node.js (https://nodejs.org/)"
echo
"2. ss3ops (会自动安装,如失败请手动安装)"
currentBuild
.
result
=
'FAILURE'
error
(
"环境检测失败: ${e.message}"
)
}
...
...
check-environment.js
View file @
2ae80615
...
...
@@ -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
*/
...
...
@@ -200,15 +165,6 @@ async function main() {
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
const
nodeInstalled
=
await
checkNode
();
if
(
!
nodeInstalled
)
{
...
...
@@ -245,7 +201,6 @@ async function main() {
}
else
{
console
.
log
(
'❌ Some environment checks failed'
);
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/'
);
process
.
exit
(
1
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment