<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      Loading

      使用私有gitlab搭建gitbook持續集成

      在項目實踐中,團隊需要對用到的知識技術進行總結,即便于分享,也利于傳承,而gitbook就是個不錯的選擇,使用gitbook-cli 對Markdown文檔進行編譯,生成靜態文件,再通過web服務器(e.g. nginx)對外提供服務。

      gitbook和gitlab搭建持續集成,可實現文檔的即時更新,這也是我在DevOps實踐的一部分。

      環境搭建

      1. 安裝 Node.js

      gitbook 是一個基于 Node.js 的命令行工具,下載安裝 Node.js,安裝完成之后,你可以使用下面的命令來檢驗是否安裝成功。

      $ node -v

      2. 安裝 gitbook

      輸入下面的命令來安裝 gitbook

      npm install gitbook-cli -g

      安裝完成之后,你可以使用下面的命令來檢驗是否安裝成功

      $ gitbook -V

      更多詳情請參照 gitbook 安裝文檔 來安裝 gitbook

      3. 安裝 Gitlab Runner

      下載二進制包

      sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64

      添加執行權限

      sudo chmod +x /usr/local/bin/gitlab-runner

      (可選)如果使用Docker,安裝Docker

      curl -sSL https://get.docker.com/ | sh

      創建 GitLab CI 用戶

      sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash

      以Service方式安裝

      sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
      sudo gitlab-runner start
      

      4. 注冊Runner

      運行以下命令

      sudo gitlab-runner register

      輸入GitLab 實例 URL Please enter the gitlab-ci coordinator URL

      輸入Gitlab注冊的token (Gitlab admin權限才能看見)

      Please enter the gitlab-ci token for this runner xxx

      輸入Runner描述,后面可在Gitlab UI上更新

      Please enter the gitlab-ci description for this runner

      輸入Runner Tag,后面可在Gitlab UI上更新

      Please enter the gitlab-ci tags for this runner (comma separated):

      選擇Runner executor

      Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell: shell

      gitbook 配置

      1. 目錄結構

              .
              ├── book.json
              ├── README.md
              ├── SUMMARY.md
              ├── chapter-1/
              |   ├── README.md
              |   └── something.md
              └── chapter-2/
                  ├── README.md
                  └── something.md
      
      • README.md
        gitbook第一頁內容是從文件 README.md 中提取的。如果這個文件名沒有出現在 SUMMARY 中,那么它會被添加為章節的第一個條目

      • book.json
        該文件主要用來存放配置信息

      • .bookignore
        將讀取.gitignore,.bookignore以及.ignore文件以獲得文件和文件夾跳過列表

      • Glossary.md
        允許指定要顯示為注釋的術語及其各自的定義。根據這些條款,GitBook將自動構建一個索引并突出顯示這些術語

      • SUMMARY.md
        用于存放GitBook的文件目錄信息,左側的目錄就是根據這個文件來生成的,默認對應的文件是 SUMMARY.md,可以在 book.json 重新定義該文件的對應值。它通過Markdown中的列表語法來表示文件的父子關系

        注意 不被SUMMARY.md包含的文件不會被gitbook處理

        SUMMARY.md示例:

        # Summary
        
        * [Introduction](README.md)
        * [Part I](part1/README.md)
            * [Writing is nice](part1/writing.md)
            * [gitbook is nice](part1/gitbook.md)
        * [Part II](part2/README.md)
            * [We love feedback](part2/feedback_please.md)
            * [Better tools for authors](part2/better_tools.md)
        

        通過使用 標題 或者 水平分割線 將 gitbook 分為幾個不同的部分,如下所示:

        # Summary
        
        ### Part I
        
        * [Introduction](README.md)
        * [Writing is nice](part1/writing.md)
        * [gitbook is nice](part1/gitbook.md)
        
        ### Part II
        
        * [We love feedback](part2/feedback_please.md)
        * [Better tools for authors](part2/better_tools.md)
        
        ---
        
        * [Last part without title](part3/title.md)
        

        目錄中的章節可以使用錨點指向文件的特定部分

        # Summary
        
        ### Part I
        
        * [Part I](part1/README.md)
            * [Writing is nice](part1/README.md#writing)
            * [gitbook is nice](part1/README.md#gitbook)
        * [Part II](part2/README.md)
            * [We love feedback](part2/README.md#feedback)
            * [Better tools for authors](part2/README.md#tools)
        

      2. 命令行

      1. gitbook init

        gitbook項目初始化,會自動生成兩個必要的文件 README.md 和 SUMMARY.md

      2. gitbook build [path]

        構建gitbook項目生成靜態網頁,會生成一個 _book 文件夾(包含了 .md 對應的.html文件)

      3. gitbook serve

        該命令實際上會首先調用 gitbook build 編譯 .md,完成以后會打開一個web服務器,監聽在本地的4000端口。

        生產的靜態文件可單獨放到tomcat或者nginx供靜態訪問

        ./
        ├── _book
        │   ├── gitbook
        │   │   ├── fonts
        │   │   ├── gitbook.js
        │   │   ├── gitbook-plugin-fontsettings
        │   │   ├── gitbook-plugin-highlight
        │   │   ├── gitbook-plugin-livereload
        │   │   ├── gitbook-plugin-lunr
        │   │   ├── gitbook-plugin-search
        │   │   ├── gitbook-plugin-sharing
        │   │   ├── images
        │   ├── index.html
        │   └── search_index.json
        ├── README.md
        └── SUMMARY.md
        
      4. gitbook update #更新gitbook到最新版本

      5. gitbook install #安裝依賴

      6. gitbook builid --debug #輸出錯誤信息

      7. gitbook build --log=debug #指定log級別

      3. 插件

      gitbook 提供了豐富插件,默認帶有 5 個插件,highlight、search、sharing、font-settings、livereload,如果要去除自帶的插件, 可以在插件名稱前面加 -,比如:

              "plugins": [
                  "-search"
              ]
      

      插件使用參考

      gitlab 與gitbook集成

      .gitlab-ci.yml 示例:

      # requiring the environment of NodeJS 10
      image: node:10
      
      # add 'node_modules' to cache for speeding up builds
      cache:
        paths:
          - node_modules/ # Node modules and dependencies
      
      before_script:
        - npm install gitbook-cli -g # install gitbook
        - gitbook fetch 3.2.3 # fetch final stable version
        - gitbook install # add any requested plugins in book.json
      
      test:
        stage: test
        script:
          - gitbook build . public # build to public path
        only:
          - branches # this job will affect every branch except 'master'
        except:
          - master
          
      # the 'pages' job will deploy and build your site to the 'public' path
      pages:
        stage: deploy
        script:
          - gitbook build . public # build to public path
        artifacts:
          paths:
            - public
          expire_in: 1 week
        only:
          - master # this job will affect only the 'master' branch
      
      

      參考

      posted @ 2020-10-17 00:00  DevOps在路上  閱讀(4305)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 最新亚洲春色av无码专区| 亚洲av午夜福利精品一区二区| 国内揄拍国内精品人妻久久| 免费国产一区二区不卡| 人妻体内射精一区二区三区 | 久久午夜夜伦鲁鲁片免费无码| 内射中出无码护士在线| 亚洲69视频| 伊人久久大香线蕉AV网禁呦| 亚洲日韩AV秘 无码一区二区 | 国产美女午夜福利视频| 日韩国产欧美精品在线| 国产免费午夜福利片在线| 国产伦精品一区二区三区妓女| 亚洲日韩精品无码一区二区三区 | 久久www免费人成看片中文| 性色在线视频精品| 日韩免费无码视频一区二区三区| 国产激情视频在线观看首页| 亚洲一精品一区二区三区| 激情国产一区二区三区四区| 亚洲婷婷综合色高清在线| 亚洲a免费| 亚洲国产精品色一区二区| 奈曼旗| 亚洲伊人精品久视频国产| 亚洲最大成人在线播放| 国产成人精品永久免费视频 | 亚洲国产精品区一区二区| 国产色a在线观看| 爽爽精品dvd蜜桃成熟时电影院| 日本熟妇乱一区二区三区| 999精品视频在线| 最近中文字幕完整版hd| 国产福利微视频一区二区| 五月天中文字幕mv在线| 五十路丰满中年熟女中出| 极品蜜桃臀一区二区av| 成人午夜av在线播放| 中文国产成人精品久久不卡| 亚洲色成人一区二区三区人人澡人人妻人人爽人人蜜桃麻豆 |