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

Artifact should contain empty directories if they match naming pattern

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 6.10.2
    • 5.4, 5.14.4.1, 6.0.3, 6.6.0, 6.7.1
    • Artifacts
    • None

      Summary

      Artifact is not copying empty folders. This behavior is recent since it was working in Bamboo 5.14.1

      Environment

      The Bamboo instances tested were running in Linux

      Steps to Reproduce

      1. Create a plan with two stages
      2. The first stage will do the following:
        1. Create the folder structure with some files:
          mkdir -p a/\{b1,b2,b3}/\{c1,c2}/d
          touch a/b1/test_b1
          touch a/b1/c1/test_c1
          
        2. Create a shared artifact with the following copy pattern:
        3. **/a/**
          
      3. The second stage will just download the artifact

      Expected Results

      The following structure is observed:

      17-Feb-2017 08:34:57	.
      17-Feb-2017 08:34:57	├── a
      17-Feb-2017 08:34:57	│   ├── b1
      17-Feb-2017 08:34:57	│   │   ├── c1
      17-Feb-2017 08:34:57	│   │   │   ├── d
      17-Feb-2017 08:34:57	│   │   │   └── test_c1
      17-Feb-2017 08:34:57	│   │   ├── c2
      17-Feb-2017 08:34:57	│   │   │   └── d
      17-Feb-2017 08:34:57	│   │   └── test_b1
      17-Feb-2017 08:34:57	│   ├── b2
      17-Feb-2017 08:34:57	│   │   ├── c1
      17-Feb-2017 08:34:57	│   │   │   └── d
      17-Feb-2017 08:34:57	│   │   └── c2
      17-Feb-2017 08:34:57	│   │       └── d
      17-Feb-2017 08:34:57	│   └── b3
      17-Feb-2017 08:34:57	│       ├── c1
      17-Feb-2017 08:34:57	│       │   └── d
      17-Feb-2017 08:34:57	│       └── c2
      17-Feb-2017 08:34:57	│           └── d
      

      Actual Results

      Only the folders with content are copied:

      17-Feb-2017 08:34:57	.
      17-Feb-2017 08:34:57	└── a
      17-Feb-2017 08:34:57	    └── b1
      17-Feb-2017 08:34:57	        ├── c1
      17-Feb-2017 08:34:57	        │   └── test_c1
      17-Feb-2017 08:34:57	        └── test_b1
      

      The same test was performed in Bamboo 5.14.1 and the whole structure is returned (Artifact definition covers the empty folders).

      Workaround

      1. Create an artifact with the whole content that should be covered by the artifact
      2. Publish this archive as the artifact
      3. Download the artifact in the next stage
      4. Unzip the artifact archive downloaded

      Currently, when a copy pattern is defined, only files are being copied into an artifact (preserving the directory layout).

      This may cause builds to fail in case a following conditions are met:

      • empty directories are present (e.g. SVN allows to version directories)
      • build scripts depend on a presence of such directory (e.g. Ant's <fileset dir="...")
      • artifact is used to pass files between jobs

      Workaround:

      Pack artifact content into an archive, share the archive file, later unpack it in a job using it.

              ezeidan Ellie Z
              mparfianowicz Marek Parfianowicz
              Votes:
              13 Vote for this issue
              Watchers:
              22 Start watching this issue

                Created:
                Updated:
                Resolved: