-
Bug
-
Resolution: Fixed
-
High
-
6.2.5
-
Severity 3 - Minor
-
3
-
Summary
Build succeeds even if artifact publishing fails
Environment
- Bamboo v6.2.5
Steps to Reproduce
- Create a plan (i.e PROJ-PLAN)
- Add a Script task
ls
- Create a Artifact Definition
Name Location Copy pattern My Artifact **/*
Expected Results
- Build should fail since there is no artifact to be published.
Actual Results
The following gets displayed in build log:
simple 19-Dec-2017 19:42:50 Publishing an artifact: My Artifact error 19-Dec-2017 19:42:50 Unable to publish artifact [My Artifact]: simple 19-Dec-2017 19:42:50 The artifact hasn't been successfully published after 50.36 ms
And the build succeeds.
One possible workaround to fail the build (bash compatible):
- Have a script task at the end of the build to check if there is any file(artifact) generated or not and fail the build if not.
cnt=`ls | wc -l` echo "Count value is: "$cnt if [ $cnt -lt 1 ] then echo "failing build as no artifacts found" exit -1 fi
Please note: The above code is bash compatible and is only for reference (You may have to script it when using Windows or any other OS). You could change this code as per your requirement to look for specific files as well.
- is duplicated by
-
BAM-13639 Shared artifacts should be configurable to optionally fail the build or not
- Closed
-
BAM-15872 Build with artifact definition passes even when no artifacts get attached
- Closed
-
BAM-16510 When artifacts can't be published a build does not fail
- Closed
-
BAM-16619 Bamboo is not failing builds when artifact failed to get published
- Closed
-
BDEV-10833 Loading...
- mentioned in
-
Page Loading...