我想建立一个包含三个操作系统(MacOSX、Windows 和 Linux)的持续集成环境。我需要构建五个不同的版本:win32bit、win64bit、lin32bit、lin64bit 和 mac。对于每个构建,我需要执行以下步骤:
-compile
-put some files in the binary folder
-make a 7z-archive of the binary folder
-upload the 7z-archive to a server
当然有依赖关系。例如,编译失败时创建和上传 7z-archive 是没有用的。
我的第一次尝试是构建一个由调度器和构建器组成的小型分层系统,但我不知道如何处理每个构建中的依赖关系:
我的计划(Start_scheduler 正在监听 svn 提交):
\Start_scheduler, kicks off win_builder, lin_builder, and mac_builder
\win_builder, compiles and uploads win32bit and win64bit
-compile 32bit
-put some files in the binary folder
-make a 7z-archive of the binary folder
-trigger upload_scheduler to upload IF 32bit compile was succesful
-compile 64bit
-put some files in the binary folder
-make a 7z-archive of the binary folder
-trigger upload_scheduler to upload IF 64bit compile was succesful
\lin_builder, compiles and uploads lin32bit and lin64bit
-compile 32bit
-put some files in the binary folder
-make a 7z-archive of the binary folder
-trigger upload_scheduler to upload IF 32bit compile was succesful
-compile 64bit
-put some files in the binary folder
-make a 7z-archive of the binary folder
-trigger upload_scheduler to upload IF 64bit compile was succesful
\mac_builder, compiles and uploads mac
-compile
-put some files in the binary folder
-make a 7z-archive of the binary folder
-triggerupload_scheduler to upload IF compile was succesful
\upload_scheduler
-upload 7z-archive to central server
-send notification about new archive
基本上我有两个问题。首先,如何定义编译和上传之间的 IF 依赖,但同时使 64 位编译独立于 32 位编译:即使 32 位失败,构建系统也应该尝试编译 64 位。其次,是否可以对 upload_scheduler 进行参数化,以便我可以在每次构建时重用它?如果我需要为每个构建维护一个单独的 upload_scheduler,那将是乏味的。