Jenkins powershell plugin always builds successfully

前端 未结 6 1654
攒了一身酷
攒了一身酷 2021-02-04 00:46

I\'m using Jenkins PowerShell plugin to build a project.

However, I found that Jenkins always considers my build successful no matter what I type inside Windows P

6条回答
  •  清歌不尽
    2021-02-04 01:32

    Per the latest version of the plugin (Version 1.3 Sept 18 2015), you must use $LastExitCode to fail a build.

    Version 1.3 (Sept 18 2015)

    • PowerShell now runs in Non-Interactive mode to prevent interactive prompts from hanging the build
    • PowerShell now runs with ExcecutionPolicy set to "Bypass" to avoid execution policy issues
    • Scripts now exit with $LastExitCode, causing non-zero exit codes to mark a build as failed
    • Added help and list of available environment variables (including English and French translations)

提交回复
热议问题