octopus-deploy - Run step only from certain version onward in Octopus deploy
问题描述
I would like to know if there is a way to run certain step in Octopus from one version onward.
I see this may be achieved by defining different channels and some "Version Rules", but I think there must be a way to do this by a "Run Condition" on the step.
I saw here that you can compare versions on Octopus.
I would like to define something like this in my "Run Condition":
#{if Octopus.Release.Number > 2.3.15}True{/if}
But I don't know exactly how to write this condition. Please let me know if you can help me.
This is necessary because sometimes we add new packages (+ step) to an existing deployment, but deployments for old releases are still being creating.
Thanks in advance.
解决方案
根据benPearce 的回答,我解决了这样的情况:
在一个名为“检查版本”的 powershell 步骤中,我写道:
$IsOver2315 = $OctopusParameters["Octopus.Release.Number"] -gt [version]"2.3.15"
Set-OctopusVariable -name "IsOver2315" -value (&{If($IsOver2315) {"True"} Else {"False"}})
在“运行条件”中,我写道:
#{Octopus.Action[Check version].Output.IsOver2315}
谢谢本皮尔斯
推荐阅读
- java - 如何防止“数据包捕获”在 android 应用程序中使用 exoplayer 库获取视频播放的 url
- css - 使搜索框响应
- bash - 获取 Bash | Laravel 问题 | 命令提示符显示奇怪的文本
- javascript - MC-Cordova-Plugin 不工作 [ionic - Angular]
- r - 面板内的R条件值分配
- javascript - getByteTimeDomain/FrequencyData() 方法如何工作
- laravel - 如何在laravel中链接关系表,我在stackoverflow上找到但没有完全理解
- java - 使用 Java 创建引用链接
- python - 从云源存储库部署时未触发 Firestore 云功能
- node.js - 在 SAP Hybris 中使用 npm 包管理器