Packages pipeline¶ 包管道 ¶
The packages pipeline will build, create and upload the package binaries for the different configurations and platforms, when some
developer is submitting some changes to one of the organization repositories source code. For example if a developer is doing some changes
to the ai package, improving some of the library functionality, and bumping the version to ai/1.1.0. If the organization needs to
support both Windows and Linux platforms, then the package pipeline will build the new ai/1.1.0 both for Windows and Linux, before
considering the changes are valid. If some of the configurations fail to build under a specific platform, it is common to consider the
changes invalid and stop the processing of those changes, until the code is fixed.
包构建管道将为不同配置和平台构建、创建并上传包二进制文件,当开发者向组织仓库的源代码提交更改时。例如,如果开发人员对 ai 包进行修改,改进部分库功能并提升版本至 ai/1.1.0 。若组织需要同时支持 Windows 和 Linux 平台,则包构建管道会在考虑更改有效性之前,先为 Windows 和 Linux 分别构建新的 ai/1.1.0 版本。如果某些配置在特定平台上构建失败,通常会将这些更改视为无效并暂停处理,直至代码修复完成。
For the package pipeline we will start with a simple source code change in the ai recipe, simulating some improvements
in the ai package, providing some better algorithms for our game.
对于 package pipeline ,我们将从 ai 配方中进行一个简单的源代码修改,模拟对 ai 包的一些改进,为我们的游戏提供一些更好的算法。
Let’s do the following changes in the ai package:
让我们在 ai 包中进行以下更改:
Let’s change the implementation of the
ai/src/ai.cppfunction and change the message fromSome ArtificialtoSUPER BETTER Artificial
让我们修改ai/src/ai.cpp函数的实现,并将消息从Some Artificial更改为SUPER BETTER Artificial。Let’s change the default
intelligence=0value inai/include/ai.hto a newintelligence=50default.
让我们将intelligence=0的默认值更改为新的intelligence=50默认值。Finally, let’s bump the version. As we did some changes to the package public headers, it would be adviced to bump the
minorversion, so let`s edit theai/conanfile.pyfile and defineversion = "1.1.0"there (instead of the previous1.0). Note that if we did some breaking changes to theaipublic API, the recommendation would be to change the major instead and create a new2.0version.
最后,让我们升级版本。由于我们对包的公共头文件进行了修改,建议升级minor版本,因此请编辑ai/conanfile.py文件并在其中定义version = "1.1.0"(替换之前的1.0)。需要注意的是,如果对ai公共 API 进行了破坏性更改,建议改为更改主版本号并创建一个新的2.0版本。
The packages pipeline will take care of building the different packages binaries for the new ai/1.1.0 and upload them to the packages
binary repository to avoid disrupting or causing potential issues to other developers and CI jobs.
If the pipeline succeed it will promote (copy) them to the products binary repository, and stop otherwise.
包构建管道将负责为新版本 ai/1.1.0 构建不同包的二进制文件,并将其上传至 packages 二进制仓库,以避免干扰其他开发者或引发潜在问题。若构建管道成功,将把二进制文件推广(复制)至 products 二进制仓库,否则构建将停止。
There are different aspects that need to be taken into account when building these binary packages for ai/1.1.0. The following tutorial sections do the same
job, but under different hypothesis. They are explained in increasing complexity.
在为 ai/1.1.0 构建这些二进制包时,需要考虑多个不同方面。以下教程章节实现了相同目标,但基于不同假设。这些内容按复杂度递增顺序进行讲解。
Note all of the commands can be found in the repository run_example.py file. This file is mostly intended for maintainers and testing,
but it might be useful as a reference in case of issues.
请注意,所有命令均可在仓库中的 run_example.py 文件中找到。该文件主要供维护人员和测试人员使用,但在遇到问题时也可作为参考。