Home > Software engineering >  How to set gitlab CI job to true?
How to set gitlab CI job to true?

Time:10-18

I would like to set a job - even when fail! - to set as TRUE (job succeeded). When using following line:

script:
    - sleep 200
    - true && false

I get following output from the CI:

true : The term 'true' is not recognized as the name of a cmdlet, function, script file, or operable program. Check 
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\WINDOWS\TEMP\build_script360729423\script.ps1:231 char:1
  true
  ~~~~
      CategoryInfo          : ObjectNotFound: (true:String) [], CommandNotFoundException
      FullyQualifiedErrorId : CommandNotFoundException

Question: How can I set my job always to TRUE with my script above?

CodePudding user response:

The Gitlab Shell executor is working with numerical returns to determine if a job failed or succeeded.

So to succeed a job to must manually exit with 0.

script:
    - sleep 200
    - exit 0
  • Related