mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-14 11:18:02 +00:00
1 line
4.0 KiB
JavaScript
1 line
4.0 KiB
JavaScript
"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5278],{7617:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>c,contentTitle:()=>r,default:()=>u,frontMatter:()=>l,metadata:()=>i,toc:()=>d});const i=JSON.parse('{"id":"deploy/cicd/agent","title":"Agent Client CI/CD","description":"- Operating System: Ubuntu 20.04 LTS","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/deploy/cicd/agent.md","sourceDirName":"deploy/cicd","slug":"/deploy/cicd/agent","permalink":"/docs/docs/deploy/cicd/agent","draft":false,"unlisted":false,"editUrl":"https://github.com/bytedesk/bytedesk/docs/deploy/cicd/agent.md","tags":[],"version":"current","sidebarPosition":3,"frontMatter":{"sidebar_label":"Agent Client","sidebar_position":3},"sidebar":"tutorialSidebar","previous":{"title":"Admin Dashboard","permalink":"/docs/docs/deploy/cicd/admin"},"next":{"title":"Visitor Client","permalink":"/docs/docs/deploy/cicd/visitor"}}');var s=t(5723),a=t(6246);const l={sidebar_label:"Agent Client",sidebar_position:3},r="Agent Client CI/CD",c={},d=[{value:"GitHub Actions",id:"github-actions",level:2},{value:"GitLab CI",id:"gitlab-ci",level:2},{value:"Jenkins Pipeline",id:"jenkins-pipeline",level:2}];function o(n){const e={admonition:"admonition",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",pre:"pre",ul:"ul",...(0,a.R)(),...n.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(e.header,{children:(0,s.jsx)(e.h1,{id:"agent-client-cicd",children:"Agent Client CI/CD"})}),"\n",(0,s.jsx)(e.admonition,{type:"tip",children:(0,s.jsxs)(e.ul,{children:["\n",(0,s.jsx)(e.li,{children:"Operating System: Ubuntu 20.04 LTS"}),"\n",(0,s.jsx)(e.li,{children:"Server Requirements: Minimum 2 cores 4GB RAM, Recommended 4 cores 8GB RAM"}),"\n"]})}),"\n",(0,s.jsx)(e.h2,{id:"github-actions",children:"GitHub Actions"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-yaml",children:'name: Build and Deploy Agent\n\non:\n push:\n branches: [ main ]\n pull_request:\n branches: [ main ]\n\njobs:\n build:\n runs-on: ubuntu-latest\n \n steps:\n - uses: actions/checkout@v2\n \n - name: Setup Node.js\n uses: actions/setup-node@v2\n with:\n node-version: \'16.x\'\n \n - name: Install Dependencies\n run: yarn install\n \n - name: Build\n run: yarn build\n \n - name: Deploy\n uses: appleboy/scp-action@master\n with:\n host: ${{ secrets.HOST }}\n username: ${{ secrets.USERNAME }}\n key: ${{ secrets.SSH_KEY }}\n source: "dist/*"\n target: "/var/www/html/weiyuai/agent/"\n'})}),"\n",(0,s.jsx)(e.h2,{id:"gitlab-ci",children:"GitLab CI"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-yaml",children:"stages:\n - build\n - deploy\n\nbuild:\n stage: build\n image: node:16\n script:\n - yarn install\n - yarn build\n artifacts:\n paths:\n - dist/\n\ndeploy:\n stage: deploy\n script:\n - rsync -avz --delete dist/ user@server:/var/www/html/weiyuai/agent/\n only:\n - main\n"})}),"\n",(0,s.jsx)(e.h2,{id:"jenkins-pipeline",children:"Jenkins Pipeline"}),"\n",(0,s.jsx)(e.pre,{children:(0,s.jsx)(e.code,{className:"language-groovy",children:"pipeline {\n agent any\n \n stages {\n stage('Build') {\n steps {\n sh 'yarn install'\n sh 'yarn build'\n }\n }\n \n stage('Deploy') {\n steps {\n sh 'rsync -avz --delete dist/ user@server:/var/www/html/weiyuai/agent/'\n }\n }\n }\n}\n"})})]})}function u(n={}){const{wrapper:e}={...(0,a.R)(),...n.components};return e?(0,s.jsx)(e,{...n,children:(0,s.jsx)(o,{...n})}):o(n)}},6246:(n,e,t)=>{t.d(e,{R:()=>l,x:()=>r});var i=t(2155);const s={},a=i.createContext(s);function l(n){const e=i.useContext(a);return i.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function r(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(s):n.components||s:l(n.components),i.createElement(a.Provider,{value:e},n.children)}}}]); |