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

Build result outputs differently if artifact dependency exists

    XMLWordPrintable

Details

    • Bug
    • Resolution: Answered
    • Low
    • None
    • 5.8.1
    • Artifacts, Dependencies

    Description

      Reproduce the issue:
      Default Stage, Default Job

      Please, add the following Script tasks

      create directory
      createFolder () {
          if [ ! -d "$1" ]; then
              echo "# ==================== #"
              echo "# create folder :: $1"
              echo "# ==================== #"
              mkdir $1
          fi
      }
      createFolder test_folder
      createFolder test2_folder
      createFolder test3_folder
      
      create file
      createFile () {
          if [ ! -f "$1/$2" ]; then
              echo "# ==================== #"
              echo "# create file :: $1/$2"
              echo "# ==================== #"
              
              echo "hello, $2" >> "$1/$2"
          fi
      }
      createFile test_folder test_file.log
      createFile test2_folder test2_file.log
      createFile test3_folder test3_file.log
      
      delete folder
      deleteFolder() {
          if [ -d "$1" ]; then
              echo "# ================ #"
              echo "delete folder $1"
              echo "# ================ #"
              rm -rf $1
          fi
      }
      # uncomment the following line to delete a folder
      #deleteFolder test2_folder
      
      delete file
      deleteFile() {
          if [ -f "$1/$2" ]; then
              echo "# ================ #"
              echo "delete file $1/$2"
              echo "# ================ #"
              rm -rf $1/$2
          fi
      }
      # uncomment the following line to delete a file
      #deleteFile test2_folder test2_file.log
      
      list content from Build Working Directory
      ls -lR
      

      Please, set the following Actifact definitions

      Name Location Copy pattern Shared
      test_file test_folder test_file.log
      test2_file test2_folder test2_file.log
      test3_file test3_folder test3_file.log
      1. please, run a build as its result will be "Successful "
      2. please, go to Script : delete file and uncomment the deleteFile command.
        11-May-2015 16:14:07	Unable to publish artifact [test2_file]:
        

        Build result: Successful

      3. please, go to Script : delete folder and uncomment the deleteFolder command.
        11-May-2015 16:25:53	Unable to publish artifact [test2_file]: the source directory <bamboo-home>/xml-data/build-dir/PROJ-PLAN-JOB1/test2_folder does not exist.
        

        Build result: Successful

      4. please, comment deleteFolder and deleteFile commands

      Now, lets create another Stage/Job so we can consume the artifacts generated

      Second Stage, Second Job

      Please, set the following Actifact dependencies

      Artifact Destination directory
      test_file  
      test2_file  
      test3_file  

      Please, add the following Script task

      display file content
      cat *.log
      
      1. please, run a build as its result will be "Successful "
      2. please, go to Script : delete file in Default Stage / Default Job and uncomment the deleteFile command.
        11-May-2015 16:31:14	Unable to publish artifact [test2_file]:
        11-May-2015 16:31:14	The artifact is required for down stream Stages and Jobs, build will now fail.
        

        Build result: Failed in Default Job

      3. please, go to Script : delete folder in Default Stage / Default Job and uncomment the deleteFolder command.
        11-May-2015 16:33:05	Unable to publish artifact [test2_file]: the source directory <bamboo-home>/xml-data/build-dir/PROJ-PLAN-JOB1/test2_folder does not exist.
        11-May-2015 16:33:05	The artifact is required for down stream Stages and Jobs, build will now fail.
        

        Build result: Failed in Default Job

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rsperafico Rafael Sperafico (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: