Publishing artifacts

When executing a job on an agent there are often artifacts created that we need to keep around. For example, JUnit creates xml reports that GoCD is able to parse in order to help you understand why the build is broken. You can use GoCD with any JUnit style xml reports. Or you might create a flash video of your UI tests that we want displayed in GoCD. You can upload any html file from your build and view it in GoCD.

To publish artifacts you add a an < artifact > to the job configuration. More information can be found on the Managing artifacts and reports page.

Example usages

Uploading JUnit xml reports

We are going to assume that the JUnit test reports are being placed in the “target/reports” folder.

Click on the Administration tab

Publish Reports and Artifacts - 图1

Click on your pipeline

Publish Reports and Artifacts - 图2

For each job that runs JUnit:

  • Click on the job name to edit job config
  • Publish Reports and Artifacts - 图3
  • Add the source of the test artifact. For tests, choose the type of artifact as Test artifact
  • Publish Reports and Artifacts - 图4
  • Click “Save”

Uploading a flash video and displaying it as a sub-tab

We are going to assume that the flash file, and the html file referencing it, are being created in the “target/reports” folder.

Click on the Admin > Pipelines tab tab

Publish Reports and Artifacts - 图5

Click on your pipeline

Publish Reports and Artifacts - 图6

For each job that creates a flash video

  • Click on the job name to edit the job config
  • Publish Reports and Artifacts - 图7
  • Navigate to the “Artifacts”. Add the source of the artifact. Choose the type of artifact as Build artifact. This will copy all files from the “target/reports” folder on the agent to the “Recording” folder on Go server
  • Publish Reports and Artifacts - 图8
  • Navigate to “Custom Tabs”. Add the tab name and the source of the html file. This will create a tab called “Recording” that shows the html page found at “recording/twist-recording.html” on GoCD server.
  • Publish Reports and Artifacts - 图9
  • Click “Save”
  • Watch the flash video as a sub-tab on the Job Details page