Skip to content

Introduce Variable to Indicate Current Build Status

Description

In the ci after_script, it would nice to have access to the current-build status. It's possible to create another step with the when clause to trigger particular action but it tends to duplicate code.

The usecase is to trigger some actions with the CI_BUILD_ID based on success/failure : eg:

after_script:
- echo ${CI_BUILD_ID}/${CI_BUILD_STATUS} 

Proposal

Add a CI_BUILD_STATUS that reflects the current build status:

  • during script: running
  • during after_script: failure or success
Edited by Mark Fletcher