Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-19582

Build succeeds when Bamboo is unable to publish artifact



      Build succeeds even if artifact publishing fails


      • Bamboo v6.2.5

      Steps to Reproduce

      • Create a plan (i.e PROJ-PLAN)
      • Add a Script task
      • 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 ] 
        echo "failing build as no artifacts found"
        exit -1

        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.

            achystoprudov Alexey Chystoprudov
            rsperafico Rafael Sperafico (Inactive)
            8 Vote for this issue
            15 Start watching this issue