Browse Source

feat: itlym.cn 同步更新

lym 2 months ago
parent
commit
a2df9d5111
2 changed files with 11 additions and 2 deletions
  1. 10 1
      .drone.yml
  2. 1 1
      script/afterGenHtml/processShoulder.sh

+ 10 - 1
.drone.yml

@@ -57,10 +57,15 @@ steps:
   volumes:
     - name: htmlDir
       path: /htmlDir
+    - name: ssh
+      path: /root/.ssh
   commands:
     # 改为在 parent 打开
     - cp -f script/afterGenHtml/pagefind-ui.js /htmlDir/pagefind/pagefind-ui.js
-
+    - whoami
+    - tar -zcf shoulder.tgz /htmlDir
+    - scp shoulder.tgz root@itlym.cn:/opt/web/
+    - ssh root@itlym.cn 'tar -zxf /opt/web/shoulder.tgz'
 #- name: 生成 html,部署web 试验区
 #  image: cnlym/maven:3-jdk-11-alpine-aliyun
 #  volumes:
@@ -87,6 +92,10 @@ volumes:
   host:
     path: /opt/web/shoulderSpecsDocxxx
 
+- name: ssh
+  host:
+    path: /root/.ssh
+
 trigger:
   branch:
   - master    

+ 1 - 1
script/afterGenHtml/processShoulder.sh

@@ -6,4 +6,4 @@ find target/generated-docs/ -type f -name "*.html" | xargs sed -i 's!<div id="do
 find target/generated-docs/ -type f -name "*.html" | xargs sed -i 's!</body>!<script>var btn = document.getElementById("search-button");var overlay = document.getElementById("overlay");btn.onclick = function(){overlay.style.display = "flex";};overlay.onclick = function(event){if (event.target == overlay){overlay.style.display = "none";}};</script></body>!g'
 
 # 对话框
-find target/generated-docs/ -type f -name "*.html" | xargs sed -i 's!</head>!<script src="https://chat.spc.itlym.cn:789/widget.js" data-welcome="Hi~ o(* ̄▽ ̄*)ブ 天赋异禀的技术人,看到这里就是缘,欢迎交流哦~" async data-host-id="1" data-auto-reg="false" data-login-token="" data-title="" data-logo="" data-theme-color="#c0ce28" data-close-width="48" data-close-height="48" data-open-width="380" data-open-height="680"></script></head>!g'
+find target/generated-docs/ -type f -name "*.html" | xargs sed -i 's!</head>!<script src="https://chat.spc.itlym.cn:789/widget.js" data-welcome="Hi~ o(* ̄▽ ̄*)ブ 天赋异禀的技术人,看到这里就是缘,欢迎交流哦~" async data-host-id="1" data-auto-reg="false" data-login-token="" data-title="" data-logo="" data-theme-color="#c0ce28" data-close-width="48" data-close-height="48" data-open-width="380" data-open-height="580"></script></head>!g'