编写 bamboo 部署任务

Writing a bamboo deployment task

我已经为 bamboo 写了几个任务。但没有一个可用于部署阶段。

我已经尝试将类别名称设置为部署,但仍然没有成功。

这是我在 atlassian 中的任务部分-plugin.xml。

<taskType key="MyDeploymentService" name="My Deployment Service" class="za.co.my.bamboo.plugin.MyDeploymentServiceTask">
<category name="deployment"/>
<configuration class="za.co.my.bamboo.plugin.MyDeploymentServiceTaskConfigurator"/>
<resource type="freemarker" name="edit" location="my/editMyDeploymentService.ftl"/>
<resource type="freemarker" name="view" location="my/viewMyDeploymentService.ftl"/>
</taskType>

TaskType Module Definition's category element within atlassian-plugin.xml is purely informational, i.e. only determines into which section of Bamboo's task selection dialog 任务将被排序。

Introduction to 5.0 - Deployments within the Bamboo Developer Documentation 部分解释了基本概念和必要的更改,以便任务支持部署项目:

Tasks are still a big component of deployments defining each individual step to get a version deployed. [...] You can find a full tutorial on developing Tasks for Bamboo on the Bamboo Tasks API page. All existing tasks should work with Bamboo 5.0 builds, but need adjusting to support deployments. [emphasis mine]

部署任务和构建任务之间的差异以及您可能需要进行的更改在后续部分接口中突出显示:

To maintain backwards compatibility with existing tasks, the original task interfaces have been left alone. We have introduced two new interfaces, a super-interface to be used when supporting BOTH builds and deployments and a Deployment specific interface

查看那里的 table 了解详细信息。根据个人经验,我可以证明,假设您的任务不使用部署任务不支持的少数概念中的任何一个(例如 构建定义、测试、Revisions/Checkouts/Build 更改 ),这些更改通常几乎是微不足道的,即用 post 5.0 接口替换 pre 5.0 现在仅构建接口, 支持构建和部署.