conan upload

使用此命令将 recipe 和二进制文件上传到 Conan 仓库。有关如何使用 Conan 仓库的更多信息,请参阅专用章节

$ conan upload -h
usage: conan upload [-h] [-v [V]] [-cc CORE_CONF] [-f FORMAT]
                    [--out-file OUT_FILE] [-p PACKAGE_QUERY] -r REMOTE
                    [--only-recipe] [--force] [--check] [-c] [--dry-run]
                    [-l LIST] [-m METADATA]
                    [pattern]

Upload packages to a remote.

By default, all the matching references are uploaded (all revisions).
By default, if a recipe reference is specified, it will upload all the revisions for all the
binary packages, unless --only-recipe is specified. You can use the "latest" placeholder at the
"reference" argument to specify the latest revision of the recipe or the package.

positional arguments:
  pattern               A pattern in the form
                        'pkg/version#revision:package_id#revision', e.g:
                        "zlib/1.2.13:*" means all binaries for zlib/1.2.13. If
                        revision is not specified, it is assumed latest one.

options:
  -h, --help            show this help message and exit
  -v [V]                Level of detail of the output. Valid options from less
                        verbose to more verbose: -vquiet, -verror, -vwarning,
                        -vnotice, -vstatus, -v or -vverbose, -vv or -vdebug,
                        -vvv or -vtrace
  -cc CORE_CONF, --core-conf CORE_CONF
                        Define core configuration, overwriting global.conf
                        values. E.g.: -cc core:non_interactive=True
  -f FORMAT, --format FORMAT
                        Select the output format: json
  --out-file OUT_FILE   Write the output of the command to the specified file
                        instead of stdout.
  -p PACKAGE_QUERY, --package-query PACKAGE_QUERY
                        Only upload packages matching a specific query. e.g:
                        os=Windows AND (arch=x86 OR compiler=gcc)
  -r REMOTE, --remote REMOTE
                        Upload to this specific remote
  --only-recipe         Upload only the recipe/s, not the binary packages.
  --force               Force the upload of the artifacts even if the revision
                        already exists in the server
  --check               Perform an integrity check, using the manifests,
                        before upload
  -c, --confirm         Upload all matching recipes without confirmation
  --dry-run             Do not execute the real upload (experimental)
  -l LIST, --list LIST  Package list file
  -m METADATA, --metadata METADATA
                        Upload the metadata, even if the package is already in
                        the server and not uploaded

conan upload 命令可以将软件包上传到由 -r=myremote 参数指定的 1 个服务器仓库。

它有 2 种可能且互斥的输入:- conan upload <pattern> 基于模式匹配的 recipe,其模式类似于 conan list <pattern>。- conan upload --list=<pkglist> 将上传 pkglist JSON 文件中指定的构件。

如果指定了 --format=json 格式化器,结果将是一个“PackageList”,与 Conan 的其他命令兼容,例如 conan remove 命令,因此可以使用生成的 JSON 文件串联不同的命令。“PackageList”还包括每个文件已上传或将要上传的 URL,为自动化或检查目的提供额外上下文。请参阅Packages Lists 示例

--dry-run 参数将准备好待上传的软件包,必要时打包,检查服务器以了解需要上传的内容以及服务器上已有的内容,但不会执行实际的上传。

使用 core.upload:parallel 配置,可以并行上传软件包。默认情况下,或当其值小于 2 时,将不进行并行处理,任何其他值都将表示要使用的并行线程数。