我们正在 teamcity 中使用 octopus-deploy 构建步骤来从另一个构建配置部署最新的成功构建。
我的目的是将版本号与工件编号相关联(工件编号又与 SCM 编号相关联)。
当我部署新版本时,octopus 会使用该版本创建一个新版本,然后部署它。
如果我再次运行 teamcity 部署步骤(对于已创建的工件),octopus 应使用相同的版本号重新部署相同的工件。 (而不是因“此版本已存在”而失败)。
从 octo.exe 文档中,--force 选项应该允许我执行此操作。 (我应该能够将其添加到 teamcity 中的“其他命令行参数”中)。
但是我收到无法识别的命令参数:--force错误。
我该如何解决这个问题?或者还有什么其他选择? (不改变工件/版本编号策略)。
通话:
octo.exe create-release --server octoServerHostName --apikey SECRET --project 项目名称 --enableservicemessages --version 1.0.59356.0 --deployto show --waitfordeployment --force
创建 Octopus Deploy 版本 [15:26:05]Octopus 部署命令行工具,版本 2.0.8.22 [15:26:05] [15:26:05]无法识别的命令参数:--force
最佳答案
在 octopus 部署 2.0+
中,您可以使用:
--ignoreexisting If a release with the version number already
exists, ignore it
--force [Optional] If a project is configured to skip
packages with already-installed versions,
override this setting to force re-deployment
(flag, default false).
要在单个 teamcity 步骤中实现您想要的效果,您需要 --ignoreexisting --force
。
关于Teamcity Octopus-deploy 集成 - 强制重新部署预先存在的版本(使用 --force 选项),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23620314/