gpt4 book ai didi

jenkins - 如何执行 shell 作为构建后操作?

转载 作者:行者123 更新时间:2023-12-02 15:24:59 25 4
gpt4 key购买 nike

我正在使用 Jenkins CI,我想添加一些构建后操作。

我尝试遵循 Execute Shell Script after post build in Jenkins 的建议post,但我找不到这样的选项(构建后任务),它应该允许我执行 shell 命令。我可以选择执行 shell,但仅限于构建

这是我的所有选项:

Jenkins - Add post-build action

文字记录:

Add post-build action:

  • Aggregate downstream test results
  • Archive the artifacts
  • Build other projects
  • Console output (build log) parsing
  • GitHub PR: add labels
  • GitHub PR: close PR
  • GitHub PR: post comment
  • GitHub PR: remove labels
  • GitHub PR: set PR status
  • Publish HTML reports
  • Publish JUnit test result report
  • Publish Javadoc
  • Record fingerprints of files to track usage
  • Use publishers from another project
  • Git Publisher
  • Build other projects (manual step)
  • E-mail Notification
  • Editable Email Notification
  • Set build status on GitHub commit [deprecated]
  • Set status for GitHub commit [universal]
  • Trigger parameterized build on other projects
  • Delete workspace when build is done

我错过了什么?

<小时/>

基本上,我需要它来销毁我的虚拟机实例,以防出现配置错误(例如vagrant destroy -f)。

我正在使用 Jenkins 版本。 2.7.1.

最佳答案

使用添加构建后操作按钮并选择构建后任务,该任务由提到的 Post build task 提供。插件:

enter image description here

之后,您将获得任务,每个任务都有一个输入字段脚本,您可以在其中执行命令:

enter image description here

关于jenkins - 如何执行 shell 作为构建后操作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38675787/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com