ynka
ynka

Reputation: 1497

Where does Bamboo look for artifacts?

I have created a Bamboo build plan that is supposed to generate artifacts. And it does - I see the generated files on the server. Unfortunately, Bamboo does not copy the files to the desired location -> it does not treat them as artifacts that I can download from Bamboo server.

I am working with Bamboo 4.3.3. The documentation tells me to describe the artifacts location relative to the "working directory", so I am trying to copy everything to ${bamboo.build.working.directory}.

I have tried different location / copy pattern settings, but to no avail.

Where should I put them? I have a scripting environment, and there is no Maven or Ant to help me.

Upvotes: 5

Views: 5790

Answers (1)

ynka
ynka

Reputation: 1497

I finally understood what was going on with my artifacts and test results that Bamboo did not see:

  1. Test results: there is a known bug that is affecting all versions up to 4.4.5, which manifests itself in scripting environments. Fortunately, it has a workaround: JUnit Parser: Test results are not found

Bamboo uses system property bamboo.fs.timestamp.precision to define FS timestamp resolution. By default it is set to 100 (ms), please set it to higher value in order to make file date check less strict. Bamboo does the check in the following way:

private boolean isFileRecentEnough(final File file)
{
  return file.lastModified() >= (taskStartDate.getTime() - SystemProperty.FS_TIMESTAMP_RESOLUTION_MS.getTypedValue());
}

Other items to check

Double check the task configuration and confirm that it is configured it to look for the test results file in the current working directory of the job (Ex.: C:\Users\ssetayeshfar\bamboo-home-445\xml-data\build-dir\PROJECT-PLAN-JOB) and NOT a sub-directory (Ex. C:\Users\ssetayeshfar\bamboo-home-445\xml-data\build-dir\PROJECT-PLAN-JOB/test-results).

In case test report is not produced by the build (it was produced earlier) use a 'touch' command right before the JUnit task.

  1. Artifacts: at the beginning of my work with Bamboo I did not understand that the working directory is defined PER JOB and tried to copy something produced in a previous job as an artifact of the current one.

Upvotes: 1

Related Questions