Reputation: 1759
I would like to know how to generate artifacts for failed builds in gitlab continuous integration, to view the html report generated by the build.
I tried like this:
artifacts:
when: on_failure
paths:
- SmokeTestResults/
- package.json
but it does not work unfortunately. I am using Gitlab 8.11.4 community edition.
Upvotes: 54
Views: 53329
Reputation: 2220
Setting it as "always" also works. Might be useful for some seekers here :-)
artifacts:
when: always
paths:
- SmokeTestResults/
- package.json
Upvotes: 12
Reputation: 6639
Using when: on_failure
will upload the artifact only when there is a failure.
To always upload the artifact despite a failure, use when: always
.
https://docs.gitlab.com/ce/ci/yaml/index.html#artifactswhen
Upvotes: 94
Reputation: 379
When, path, and the files should all be at the same level
artifacts:
when: on_failure
paths:
- SmokeTestResults/
- package.json
Upvotes: 37