B
一键发布更新内容到vdoing网站
刺激
版权
自己写的。
环境
自己开源的 《vuepress-theme-vdoing-one-public》网站模板。
此模板是在Young Kbt blog的开源项目《Kele-Bingtang.github.io》基础上修改为自己的风格而成,感谢大佬开源的模板&感谢原作者开源的vdoing主题。❤️❤️
背景
NOTE
你想一键推送自己本地知识库更新内容到网站吗?
行的话,只需要粘贴执行以下脚本就好。😂
执行脚本
拉取仓库后在vscode里需要做的配置:
拉取项目后,直接在vscode里执行如下代码就好:
bash
cat>>/etc/profile<<EOFalias nd="sh -x /d/vuepress-theme-vdoing-one-private/shell/vdoing-run-dev.sh"EOFcat>>/etc/profile<<EOFalias nb="sh -x /d/vuepress-theme-vdoing-one-private/shell/vdoing-run-build.sh"EOFcat>>/etc/profile<<EOFalias xyy="sh -x /d/vuepress-theme-vdoing-one-private/shell/vdoing.sh"EOFcat>>/etc/profile<<EOFalias gs="cd /d/vuepress-theme-vdoing-one-private/git status"EOFcat>>/etc/profile<<EOFalias gp="cd /d/vuepress-theme-vdoing-one-private/git pull"EOFcat>>/etc/profile<<EOFalias gg="cd /d/vuepress-theme-vdoing-one-private/git statusgit pullgit add -Agit commit -m'commit data'git pushgit status"EOFsource/etc/profile
测试过程
案例:shell脚本一键完成vdoing-提交+构建+推送工作流
环境
2024年12月23日测试
基于官方https:#提交cd/d/vuepress-theme-vdoing-onegitpullgitadd-Agitcommit-m"update data"gitpush#构建cd/d/vuepress-theme-vdoing-onenpmrunbuild:winecho"推送winodws site数据到ecs:"/d/vuepress-theme-vdoing-one/shell/vdoing.batecho"rsync:rsync数据winodws-->ecs推送成功!"echo""echo""
D:\vuepress-theme-vdoing-one\shell\vdoing.bat
bat
::添加自己要执行的任务echoPush winodws docusaurus static data to ecs...rsync.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配置:
bash
cat>>/etc/profile<<EOFalias xyy="sh -x /d/vuepress-theme-vdoing-one/shell/vdoing.sh"EOFsource/etc/profile
当前状态
一键执行xyy
命令
效果
网站观察效果
之前新增的内容出现了:(完美😜)
构建别名
nd
nb
😜
shell代码
bash
cat>>/d/vuepress-theme-vdoing-one/shell/vdoing-run-dev.sh<<EOFcd /d/vuepress-theme-vdoing-one/npm run dev:win"EOFcat>>/etc/profile<<EOFalias nd="sh -x /d/vuepress-theme-vdoing-one/shell/vdoing-run-dev.sh"EOFsource/etc/profilecat>>/d/vuepress-theme-vdoing-one/shell/vdoing-run-build.sh<<EOFcd /d/vuepress-theme-vdoing-one/npm run build:win"EOFcat>>/etc/profile<<EOFalias nb="sh -x /d/vuepress-theme-vdoing-one/shell/vdoing-run-build.sh"EOFsource/etc/profile
测试效果
完美。😜