增强 Builder 发布流程

发布于 2024-11-25 01:32:23 字数 90 浏览 1 评论 0原文

我想将自定义任务绑定到默认构建器发布周期中。我想在项目编译、打包、标记和部署之后但在增加版本号并提交之前运行此代码。

我将如何融入发布周期的这一部分?

I'd like to tie a custom task into the default buildr release cycle. I'd like to run this code after the project has been compiled, packaged, tagged and deployed but before it increments the version number and commits that.

How would I tie into this part of the release cycle?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天荒地未老 2024-12-02 01:32:23

不幸的是,release 任务并不由您可以使用自己的任务挂钩和扩展的子任务组成。

引用当前的实现,

# Make a release.
def make
  @this_version = extract_version
  check
  with_release_candidate_version do |release_candidate_buildfile|
    args = '-S', 'buildr', "_#{Buildr::VERSION}_", '--buildfile', release_candidate_buildfile
    args << '--environment' << Buildr.environment unless Buildr.environment.to_s.empty?
    args << 'clean' << 'upload' << 'DEBUG=no'
    ruby *args
  end
  tag_release resolve_tag
  update_version_to_next if this_version != resolve_next_version(this_version)
end

如您所见,Buildr 分叉了一个单独的进程,并且本质上运行 buildr clean upload 一种可能是增强 上传 > 任务并将您的任务添加为依赖项,例如,

task :my_custom_task do
  # do stuff
end

task :upload => [ :my_custom_task ]

如果这不能满足您的需求,我建议在 https://issues.apache.org/jira/browse/BUILDR

Unfortunately, the release task isn't composed of sub-tasks that you could potentially hook into and extend with your own task(s).

To quote the current implementation,

# Make a release.
def make
  @this_version = extract_version
  check
  with_release_candidate_version do |release_candidate_buildfile|
    args = '-S', 'buildr', "_#{Buildr::VERSION}_", '--buildfile', release_candidate_buildfile
    args << '--environment' << Buildr.environment unless Buildr.environment.to_s.empty?
    args << 'clean' << 'upload' << 'DEBUG=no'
    ruby *args
  end
  tag_release resolve_tag
  update_version_to_next if this_version != resolve_next_version(this_version)
end

As you can see, Buildr forks a separate process and essentially runs buildr clean upload One possibility would be to enhance the upload task and add your tasks as dependencies, e.g.,

task :my_custom_task do
  # do stuff
end

task :upload => [ :my_custom_task ]

If this doesn't meet your needs, I'd recommend opening an enhancement request at https://issues.apache.org/jira/browse/BUILDR.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文