1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        OtaPackageToolOTA 打包工具

        聯(lián)合創(chuàng)作 · 2023-10-01 05:59

        OtaPackageTool 是一個 OTA 打包工具,使用 git 獲取不同提交之間的文件差異實現(xiàn)OTA包生成。

        OtaPackageTool 工具默認提供了一個 linux-x86-64 的可執(zhí)行文件,放于開源項目的 bin 目錄下。該工具能夠構建兩種類型的包: 全量包和增量包。支持 tar 和 zip 兩種文件類型的包文件。實現(xiàn) OTA 包的構建,需要借助 git 實現(xiàn)版本文件的管理。

        安裝

        二進制安裝

        OtaPackageTool 工具默認提供了一個 linux-x86-64 的可執(zhí)行文件,放于開源項目的 bin 目錄下。只需要克隆下載下來,即可執(zhí)行:

        $ git clone https://github.com/yicm/OtaPackageTool.git
        $ cd OtaPackageTool/bin
        $ ./ota_packer -h
        

        源碼編譯安裝

        $ git clone https://github.com/yicm/OtaPackageTool.git
        $ cd OtaPackageTool
        $ go build -o bin ./...
        

        編譯完成后,生成的可執(zhí)行文件已經(jīng)輸出到 bin 目錄下。

        使用

        準備

        1. 將 OtaPackageTool 添加到環(huán)境變量 $PATH (這里就不展開如何添加了)
        2. 進入你的軟件版本管理倉庫根目錄
        $ cd your_installation_file_version_repository
        
        1. 就可以運行 OtaPackageTool 相關的打包功能了

        示例

        # -----------------------------------------------
        ---
        # 查看工具版本
        $ ota_packer version
        ota_packer version 0.0.1
        
        # --------------------------------------------------
        # 查看工具幫助
        $ ota_packer -h
        Archive of the diff files using git on Linux system.
        
        Usage:
          ota_packer [command]
        
        Available Commands:
          gen         Generate package file
          help        Help about any command
          version     Get version of ota_packer
        
        Flags:
          -c, --config string         Config file (default is $HOME/.ota_packer.yaml)
          -h, --help                  help for ota_packer
          -n, --project-name string   Your project name (default "OTA")
        
        Use "ota_packer [command] --help" for more information about a command.
        
        # --------------------------------------------------
        # 查看OTA包生成幫助
        $ ota_packer gen -h
        Generate a specific version package by entering different configuration parameters.
        
        Usage:
          ota_packer gen [flags]
        
        Flags:
          -F, --diff-filter string       git diff --diff-filter and a similar designation (default "ACMRT")
          -e, --end-commit-id string     End revision (default "HEAD")
          -f, --format string            The format of the archive, supporting zip and tar (default "tar")
          -h, --help                     help for gen
          -o, --output string            Output destination path of the archive
          -p, --prefix string            Prefixed to the filename in the archive while project name is not set. (default "ota_packer")
          -s, --start-commit-id string   Start revision (default "HEAD~1")
          -v, --verbose                  Show packaging process statistics
        
        Global Flags:
          -c, --config string         Config file (default is $HOME/.ota_packer.yaml)
          -n, --project-name string   Your project name (default "OTA")
        

        全量包

        如果設置 --start-commit-id 與 --end-commit-id 的值一致,則會生成當前 commit id 的全量包。如:

        $ ota_packer gen -s HEAD -e HEAD
        $ ota_packer gen -s HEAD~1 -e HEAD~1
        $ ota_packer gen -s HEAD~3 -e HEAD~1
        $ ota_packer gen -s 6bc76a1f -e 6bc76a1f
        

        增量包生成

        可以設置從某個提交版本升級/降級到指定版本,升級的化則需要 --start-commit-id 提交時間在 --end-commit-id 之前,否則的話就是生成的就是降級包。示例:

        # 默認 --start-commit-id=HEAD~1, --end-commit-id=HEAD
        $ ota_packer gen
        $ ota_packer gen -s HEAD~2 -e HEAD~0
        $ ota_packer gen -s 6bc76a1f -e 9d31d032
        
        # Set output path as 'tmp' directory, and set project name as 'Test'
        $ ./output/ota_packer gen -s HEAD~1 -e HEAD~0 -o tmp -n "Test"
        -----------------------------------------------------------------
            Project Name  |  Test
        ------------------+----------------------------------------------
             Output Path  |  tmp/
        ------------------+----------------------------------------------
                  Output  |  Test-20200630145419-6bc76a1-to-9d31d03.tar
        ------------------+----------------------------------------------
               Changelog  |  ota_info.json
        ------------------+----------------------------------------------
        {
            "project_name": "Test",
            "last_ota_version": "6bc76a1",
            "ota_version": "9d31d03",
            "is_full_update": false,
            "changes": [
                {
                    "type": "D",
                    "old_path": "models/y.model",
                    "new_path": "models/y.model"
                }
            ]
        }
        ------------------+----------------------------------------------
        

        關于OTA包版本之間文件變更類型說明

        A:  新增了該文件
        C:  從一個文件復制到另一個文件
        D:  刪除了該文件
        M:  修改了該文件
        R:  重命名了該文件(可能路徑有所變化)
        T:  更改該文件的類型
        

        OtaPackageTool 使用條件

        • Git v2.27.0 版本或以上
        • UNIX 或類 UNIX 系統(tǒng)
        • Go1.13+ (可選,源碼安裝時需要)
        瀏覽 31
        點贊
        評論
        收藏
        分享

        手機掃一掃分享

        編輯 分享
        舉報
        評論
        圖片
        表情
        推薦
        點贊
        評論
        收藏
        分享

        手機掃一掃分享

        編輯 分享
        舉報
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            狠狠干在线 | 天天日天天舔天天射 | 92看片 | 国产破处视频在线播放 | 极品少妇XXXX精品少妇偷拍 | 日韩特黄一级 | 黄色毛片视频 | 娇妻被健身教练挺进嗯啊视频 | 日本无码中文字幕 | 久久九九视频 |