hugo-teek is loading...

一键发布更新内容到vdoing网站

最后更新于:

刺激

版权

自己写的。

环境

自己开源的 《vuepress-theme-vdoing-one-public》网站模板。

此模板是在Young Kbt blog的开源项目《Kele-Bingtang.github.io》基础上修改为自己的风格而成,感谢大佬开源的模板&感谢原作者开源的vdoing主题。❤️❤️

背景

NOTE

> 你想一键推送自己本地知识库更新内容到网站吗?

>

> 行的话,只需要粘贴执行以下脚本就好。😂

执行脚本

拉取仓库后在vscode里需要做的配置:

拉取项目后,直接在vscode里执行如下代码就好:

 1cat >>/etc/profile <<EOF
 2alias nd="
 3sh -x /d/vuepress-theme-vdoing-one-private/shell/vdoing-run-dev.sh
 4"
 5EOF
 6
 7cat >>/etc/profile <<EOF
 8alias nb="
 9sh -x /d/vuepress-theme-vdoing-one-private/shell/vdoing-run-build.sh
10"
11EOF
12
13
14cat >>/etc/profile <<EOF
15alias xyy="
16sh -x /d/vuepress-theme-vdoing-one-private/shell/vdoing.sh
17"
18EOF
19
20
21cat >>/etc/profile <<EOF
22alias gs="
23cd /d/vuepress-theme-vdoing-one-private/
24git status
25"
26EOF
27
28
29cat >>/etc/profile <<EOF
30alias gp="
31cd /d/vuepress-theme-vdoing-one-private/
32git pull
33"
34EOF
35
36
37cat >>/etc/profile <<EOF
38alias gg="
39cd /d/vuepress-theme-vdoing-one-private/
40git status
41git pull
42git add -A
43git commit -m'commit data'
44git push
45git status
46"
47EOF
48
49source /etc/profile

测试过程

案例:shell脚本一键完成vdoing-提交+构建+推送工作流

环境

2024年12月23日测试

基于官方https://github.com/xugaoyi/vuepress-theme-vdoing搭建的仓库。

image-20241223130417258

代码配置

D:\vuepress-theme-vdoing-one\shell\vdoing.sh

image-20241231074102504

 1#!/bin/bash
 2
 3#提交
 4cd /d/vuepress-theme-vdoing-one
 5git pull
 6git add -A
 7git commit -m"update data"
 8git push
 9
10#构建
11cd /d/vuepress-theme-vdoing-one
12npm run build:win
13
14
15echo "推送winodws site数据到ecs:"
16/d/vuepress-theme-vdoing-one/shell/vdoing.bat
17echo "rsync: rsync数据winodws-->ecs推送成功!"
18echo ""
19echo ""

D:\vuepress-theme-vdoing-one\shell\vdoing.bat

1::添加自己要执行的任务
2echo  Push winodws docusaurus static data to ecs...
3rsync.exe -avPzruh --delete --port 8730 --password-file=/cygdrive/D/docusaurus/resource/shell/password.txt /cygdrive/D/vuepress-theme-vdoing-one/docs/.vuepress/dist root@云服务器ip::cmi-vue/

自己vscode配置:

1cat >>/etc/profile <<EOF
2alias xyy="
3sh -x /d/vuepress-theme-vdoing-one/shell/vdoing.sh
4"
5EOF
6
7source /etc/profile

image-20241223210814167

当前状态

image-20241223205908003

一键执行xyy命令

image-20241223205922446

效果

image-20241223210254244

image-20241223210312276

网站观察效果

之前新增的内容出现了:(完美😜)

image-20241223210513084

构建别名

nd

nb

😜

shell代码

 1cat >>/d/vuepress-theme-vdoing-one/shell/vdoing-run-dev.sh <<EOF
 2cd /d/vuepress-theme-vdoing-one/
 3npm run dev:win
 4"
 5EOF
 6
 7cat >>/etc/profile <<EOF
 8alias nd="
 9sh -x /d/vuepress-theme-vdoing-one/shell/vdoing-run-dev.sh
10"
11EOF
12
13source /etc/profile
14
15
16
17
18cat >>/d/vuepress-theme-vdoing-one/shell/vdoing-run-build.sh <<EOF
19cd /d/vuepress-theme-vdoing-one/
20npm run build:win
21"
22EOF
23
24cat >>/etc/profile <<EOF
25alias nb="
26sh -x /d/vuepress-theme-vdoing-one/shell/vdoing-run-build.sh
27"
28EOF
29
30source /etc/profile

image-20241231074150194

测试效果

image-20241224071447888

image-20241224071809135

完美。😜

推荐使用微信支付
微信支付二维码
推荐使用支付宝
支付宝二维码
最新文章

文档导航