In a project I\'m working on, we are using shell scripts to execute different tasks. Some are sh/bash scripts that run rsync, and some are PHP scripts. One of the PHP script
You should use Jenkinsfile to wrap your build script and simply mark the current build as UNSTABLE by using currentBuild.result = "UNSTABLE".
currentBuild.result = "UNSTABLE"
stage { status = /* your build command goes here */ if (status === "MARK-AS-UNSTABLE") { currentBuild.result = "UNSTABLE" } }