I have a step in mine .gitlab-ci.ymlto run a script that generates some artifacts. Under normal circumstances, the directory contains artifacts, and they are picked up as such by gitlab-ci. But I'm trying to adjust the situation so that the task fails if there are no artifacts. All I get now is a warning in a log that says there are no artifacts. I want to treat this warning as an error and not complete the task. Is there any way to do this?
I suggested that I could just update my bash script to display a non-zero value if there are no artifacts, but I would like to do this in the gitlab task definition, if possible.
rpm_build:
stage: build
script: ./scripts/build_rpms.sh
artifacts:
paths:
- my/RPMS/
expire_in: 3 days
I looked through the documentation for the artifacts section, but found nothing.
https://docs.gitlab.com/ce/ci/yaml/#artifacts
source
share