本文档翻译自:https://docs.conan.io/en/latest/reference/commands/creator/upload.html
$ conan upload [-h] [-p PACKAGE] [-q QUERY] [-r REMOTE] [--all]
[--skip-upload] [--force] [--check] [-c] [--retry RETRY]
[--retry-wait RETRY_WAIT] [-no [{all,recipe}]] [-j JSON]
[--parallel]
pattern_or_reference
将配方和二进制软件包上传到远程服务器。
如果未指定任何远程服务器,则将使用第一个配置的远程服务器(默认情况下为conan-center,使用“ conan remote list”查看远程服务器列表)。
positional arguments:
pattern_or_reference Pattern, recipe reference or package reference e.g.,
'boost/*', 'MyPackage/1.2@user/channel', 'MyPackage/1.
2@user/channel:af7901d8bdfde621d086181aa1c495c25a17b13
7'
optional arguments:
-h, --help show this help message and exit
-p PACKAGE, --package PACKAGE
Package ID [DEPRECATED: use full reference instead]
-q QUERY, --query QUERY
Only upload packages matching a specific query.
Packages query: 'os=Windows AND (arch=x86 OR
compiler=gcc)'. The 'pattern_or_reference' parameter
has to be a reference: MyPackage/1.2@user/channel
-r REMOTE, --remote REMOTE
upload to this specific remote
--all Upload both package recipe and packages
--skip-upload Do not upload anything, just run the checks and the
compression
--force Ignore checks before uploading the recipe: it will
bypass missing fields in the scm attribute and it will
override remote recipe with local regardless of recipe
date
--check Perform an integrity check, using the manifests,
before upload
-c, --confirm Upload all matching recipes without confirmation
--retry RETRY In case of fail retries to upload again the specified
times.
--retry-wait RETRY_WAIT
Waits specified seconds before retry again
-no [{all,recipe}], --no-overwrite [{all,recipe}]
Uploads package only if recipe is the same as the
remote one
-j JSON, --json JSON json file path where the upload information will be
written to
--parallel Upload files in parallel using multiple threads The
default number of launched threads is 8
Examples:
上传软件包配方(conanfile.py和导出的文件):
$ conan upload OpenCV/1.4.0@lasote/stable
上传软件包配方和单个二进制软件包:
$ conan upload OpenCV/1.4.0@lasote/stable:d50a0d523d98c15bb147b18fa7d203887c38be8b
将软件包配方和所有生成的二进制软件包上传到指定的远程服务器:
$ conan upload OpenCV/1.4.0@lasote/stable --all -r my_remote
将所有配方和二进制包从我们的本地缓存上传到my_remote
,而无需确认:
$ conan upload "*" --all -r my_remote -c
将OpenCV的配方以及使用设置arch=x86_64和os=Linux构建的任何二进制软件包从我们的本地缓存上传到my_remote:
$ conan upload OpenCV/1.4.0@lasote/stable -q 'arch=x86_64 and os=Linux' -r my_remote
上传所有本地软件包和配方,以“ Op”开头,重试3次,并在两次上载尝试之间等待10秒:
$ conan upload "Op*" --all -r my_remote -c --retry 3 --retry-wait 10
如果不更改配方,则上传软件包而不覆盖配方和软件包:
$ conan upload OpenCV/1.4.0@lasote/stable --all --no-overwrite # defaults to --no-overwrite all
如果软件包已更改,则在不覆盖配方的情况下上传软件包:
$ conan upload OpenCV/1.4.0@lasote/stable --all --no-overwrite recipe
使用多个线程上传软件包,而无需确认my_remote:
$ conan upload "*" --confirm --parallel -r my_remote
:::success
Waring
请注意,使用并行上传时,non_interactive模式将被强制为true
:::