第一章
This commit is contained in:
@@ -12,5 +12,72 @@ http://admin:11baa9476a69d087e9d6d72e315a3f725e@118.25.129.153:3001/job/gitea-au
|
||||
|
||||
http://admin:11baa9476a69d087e9d6d72e315a3f725e@118.25.129.153:3001/job/auto-test/build?token=12345
|
||||
|
||||
流水线:
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
tools{
|
||||
nodejs 'NodeJS20'
|
||||
}
|
||||
stages {
|
||||
stage('代码拉取') {
|
||||
steps {
|
||||
git url: 'http://118.25.129.153:3000/zhihui/suanfa.git',
|
||||
branch: 'main'
|
||||
echo '✅ 代码拉取成功'
|
||||
}
|
||||
}
|
||||
stage('设置NPM镜像'){
|
||||
steps{
|
||||
sh '''
|
||||
npm config set registry https://mirrors.cloud.tencent.com/npm/
|
||||
echo "当前 npm 镜像源:"
|
||||
npm config get registry
|
||||
'''
|
||||
}
|
||||
}
|
||||
stage('安装依赖'){
|
||||
steps{
|
||||
sh 'npm install'
|
||||
}
|
||||
}
|
||||
stage('执行依赖'){
|
||||
steps{
|
||||
sh 'npm run build'
|
||||
}
|
||||
}
|
||||
stage('保存成果'){
|
||||
steps{
|
||||
archiveArtifacts artifacts: 'dist/**/*', allowEmptyArchive: true
|
||||
echo '📦 构建产物已保存'
|
||||
}
|
||||
}
|
||||
stage('部署到 Web 服务') {
|
||||
steps {
|
||||
echo '🚀 开始部署前端文件...'
|
||||
script {
|
||||
// 确保目标目录存在
|
||||
sh 'mkdir -p /app/www'
|
||||
// 清空旧文件
|
||||
sh 'rm -rf /app/www/*'
|
||||
// 复制新构建的 dist 文件到挂载目录
|
||||
sh 'cp -r dist/* /app/www/'
|
||||
|
||||
echo '✅ 前端文件部署完成!'
|
||||
|
||||
// 可选:列出部署的文件以便验证
|
||||
sh 'ls -la /app/www/ | head -10'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post{
|
||||
success{
|
||||
echo '🎉 构建成功!'
|
||||
}
|
||||
failure{
|
||||
echo '❌ 构建失败,请检查代码!'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OK
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
export const chapters = [
|
||||
{
|
||||
id: 'ch1',
|
||||
title: '第一章 基础 — 复杂度分析',
|
||||
title: '第一章 算法基础 — 复杂度分析',
|
||||
subtitle: '算法时间复杂度与空间复杂度基础',
|
||||
description: '本章介绍算法分析的基础知识,包括时间复杂度、空间复杂度的概念,以及通过实验比较不同算法的性能差异。',
|
||||
icon: '📊',
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
<div class="hero-content">
|
||||
<div class="hero-badge">🎓 教学辅助平台</div>
|
||||
<h1 class="hero-title">
|
||||
<span class="hero-title-line">算法分析与设计</span>
|
||||
<span class="hero-title-line">算法设计与分析</span>
|
||||
</h1>
|
||||
<p class="hero-subtitle">从基础到进阶的算法学习之旅</p>
|
||||
<p class="hero-desc">
|
||||
|
||||
Reference in New Issue
Block a user