.
This commit is contained in:
parent
424eb06417
commit
eeebdae492
60
Jenkinsfile
vendored
Normal file
60
Jenkinsfile
vendored
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
tools {
|
||||||
|
nodejs 'node-v18.18.2' // 使用全局配置的Node.js工具
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Checkout') {
|
||||||
|
steps {
|
||||||
|
// 从Git仓库克隆项目
|
||||||
|
checkout scmGit(branches: [[name: '*/master']], extensions: [], userRemoteConfigs: [[credentialsId: '4a774ecd-6ae3-4e27-a5e6-e6488b93b28a', url: 'https://gitea.1216.top/lxy/z-docs.git']])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Install Dependencies') {
|
||||||
|
steps {
|
||||||
|
// 使用配置的Node.js版本安装项目依赖
|
||||||
|
sh '''
|
||||||
|
npm config set registry https://registry.npmmirror.com/
|
||||||
|
npm install
|
||||||
|
'''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
// 执行构建步骤,比如打包
|
||||||
|
sh 'npm run build' // 假设你的package.json中有一个名为build的脚本用于打包
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('deploy') {
|
||||||
|
steps {
|
||||||
|
sshPublisher(publishers: [sshPublisherDesc(
|
||||||
|
configName: 'u-xg', // SSH服务器的配置名称
|
||||||
|
transfers: [sshTransfer(
|
||||||
|
cleanRemote: false,
|
||||||
|
execCommand: '''
|
||||||
|
// 这里可以添加在远程机器上执行的其他命令
|
||||||
|
cd /var/www
|
||||||
|
rm zhub-docs -rf
|
||||||
|
mv z-docs zhub-docs
|
||||||
|
''',
|
||||||
|
execTimeout: 120000,
|
||||||
|
flatten: false, // 是否将源文件扁平化到单个目录中
|
||||||
|
makeEmptyDirs: true, // 是否创建远程目录结构
|
||||||
|
noDefaultExcludes: false,
|
||||||
|
patternSeparator: '[, ]+',
|
||||||
|
remoteDirectory: '/var/www/z-docs', // 远程机器上的目标目录
|
||||||
|
removePrefix: 'dist/', // 如果需要,从源文件名中移除的前缀
|
||||||
|
sourceFiles: 'dist/**' // 要传输的文件模式,这里表示dist目录及其所有内容
|
||||||
|
)],
|
||||||
|
usePromotionTimestamp: false,
|
||||||
|
useWorkspaceInPromotion: false,
|
||||||
|
verbose: true // 设置为true以获取更详细的日志输出
|
||||||
|
)])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
@ -11,7 +11,7 @@ const config = {
|
|||||||
favicon: 'img/favicon.ico',
|
favicon: 'img/favicon.ico',
|
||||||
|
|
||||||
// Set the production url of your site here
|
// Set the production url of your site here
|
||||||
url: 'https://zhub.1216.top',
|
url: 'https://zhub.dev',
|
||||||
// Set the /<baseUrl>/ pathname under which your site is served
|
// Set the /<baseUrl>/ pathname under which your site is served
|
||||||
// For GitHub pages deployment, it is often '/<projectName>/'
|
// For GitHub pages deployment, it is often '/<projectName>/'
|
||||||
baseUrl: '/',
|
baseUrl: '/',
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
/* You can override the default Infima variables here. */
|
/* You can override the default Infima variables here. */
|
||||||
:root {
|
:root {
|
||||||
--ifm-color-primary: #852e79;
|
--ifm-color-primary: #2e4785;
|
||||||
--ifm-color-primary-dark: #29784c;
|
--ifm-color-primary-dark: #29784c;
|
||||||
--ifm-color-primary-darker: #277148;
|
--ifm-color-primary-darker: #277148;
|
||||||
--ifm-color-primary-darkest: #205d3b;
|
--ifm-color-primary-darkest: #205d3b;
|
||||||
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
||||||
[data-theme='dark'] {
|
[data-theme='dark'] {
|
||||||
--ifm-color-primary: #852e79;
|
--ifm-color-primary: #475c98;
|
||||||
--ifm-color-primary-dark: #21af90;
|
--ifm-color-primary-dark: #21af90;
|
||||||
--ifm-color-primary-darker: #1fa588;
|
--ifm-color-primary-darker: #1fa588;
|
||||||
--ifm-color-primary-darkest: #1a8870;
|
--ifm-color-primary-darkest: #1a8870;
|
||||||
|
Loading…
Reference in New Issue
Block a user