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
- Create a plan with two stages
- The first stage will do the following:
- 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
- Create a shared artifact with the following copy pattern:
**/a/**
- Create the folder structure with some files:
- 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
- Create an artifact with the whole content that should be covered by the artifact
- Publish this archive as the artifact
- Download the artifact in the next stage
- 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.
- is duplicated by
-
BAM-18190 Artifact is not copying empty folders
-
- Closed
-
- mentioned in
-
Page Loading...
- was cloned as
-
BDEV-11691 Loading...