Search code examples
teamcityexitjobs

Mark as successful action for builds in Teamcity


I have a question to all the experienced Teamcity users out there. I would like to exit out of a job based on a particular condition, but I do not want the status of the job as a failure. Is it possible to mark a job as successful even when you exit out of the job with an "exit code 1" or any pointers to achieve the same (exit out of a Teamcity job but mark the job as successful) through an alternative way is greatly appreciated! Thanks!


Solution

  • You can use TeamCity service messages to update build status, e.g. write to the output

    ##teamcity[buildStatus status='SUCCESS' text='{build.status.text} and then made green']
    

    to get build status text concatenated with the and then made green string.