简体   繁体   中英

How to execute shell as post-build action?

I'm using Jenkins CI and I would like to add some post-build actions.

I've tried to follow suggestions from Execute Shell Script after post build in Jenkins post, but I cannot find such option ( Post build task ) which should allow me to execute shell commands. I can select Execute shell , but only for Build .

Here are my all options:

Jenkins  - 添加构建后操作

Transcript:

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

What am I missing?


Basically I need this to destroy my VM instance in case of provisioning error (eg vagrant destroy -f ).

I'm using Jenkins ver. 2.7.1.

Use the Add post-build action button and select Post build task , which is provided by the mentioned Post build task plugin:

在此输入图像描述

Afterwards, you have Tasks, each with an input field Script , where you can execute your commands:

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM