|Table of Contents|
What are Artifacts?
Artifacts are files that were involved in the build process that are then registered in Continua CI as important files. By registering a file as an artifact, it can then be viewed through the browser or downloaded to the current user's computer. Artifacts are declared at the end of each stage by specifying artifact rules.
For a file to be an artifact, it must be located in the server's workspace. Files are declared as artifacts on each stage after the agent has finished syncing files with the server. This means that files that should become artifacts must be in the server's workspace both at the end of the stand and once the build has finished. All artifacts are relative to the server's workspace which means files in other locations cannot be added as artifacts.
Artifacts can only be viewed or downloaded if a user has the View/Download Artifacts permission.
Files that are registered as artifacts can be viewed on a specific build by navigating to the artifacts tab. On this page you will find every artifact that is linked to the current build.
On this page you can download and view individual artifacts. All artifacts will be downloadable but only certain types can be viewed. When an artifact is viewable you will see one of two options [View] or [View As]. If you see [View] then Continua has only one way to view the artifact and that's by opening a new browser window allowing the browser to interpret how to view that type of file
If an artifact has a [View As] link then it can be viewed the following ways:
- Raw: This will open a new tab and the browser will attempt to open the file. The artifact and the artifact's file type are both sent to the browser and it is up to the browser how the file will be generated (Note that different browsers render file types differently). This means that this method should only be used on files that can be viewed through the browser.
- Special Views: File types can be associated with special views. See the next section for more information on these views.
Special Artifact Views
Artifacts can be associated an artifact type when specifying artifact rules. If an artifact is associated to one of these types, they can be opened in a special view within the Continua artifacts page. Check out the Artifact Rules page for more information on how to assign a view type to artifacts.
Continua currently supports the following special views.
The Image special view is designed for any image files, i.e. .png, .bmp, .gif, .jpeg, etc. By setting an artifact to the image type you can then view those images straight from the artifacts page.
A file can be typed as an image by adding the image type to the artifact rule. For example, if I want all .pngs in my output folder to be image artifacts, I would use the following artifact rule: image | output\*.png
The image view is shown below.
The NUnit special view is designed for .xml output files that are generated by NUnit. This special view generates a custom view based on the NUnit results. This view is shown below.
A file can be typed as NUnit by adding the NUnit type to the artifact rule. For example, if I want my tests.xml to be a NUnit artifact and this xml is in the output directory of the server's workspace, I would use the following artifact rule: nunit | output\tests.xml
Note that any non-NUnit files that are given the NUnit type will not display correctly. This type should only be used for NUnit xml files.
The variable special view is mainly used for artifacts that are automatically generated for every build. These artifacts are:
- <agent_name>_Environment.xml: These files list all environment variables that are located on a specific agent. This file is generated while a stage is executing on a particular agent. If a build has multiple stages and these stages are run on multiple agents then you will get multiple <agent_name>_Environment.xml files.
- VariableNamespaces.xml: This artifact lists every Continua variable including the variables value at the end of the build. This file will list global, project, configuration and build variables.
How do I Create Artifacts?
Artifacts can be created through the configuration wizard in the Stage section. Artifacts can be added to any stage in the build process by creating Artifact Rules on that stage. See the Stage Options page for more information.
Help, My Artifacts No Longer Exist in the Workspace!
Artifacts can be missing from your workspace for a variety of reasons. If you see the error File '<your_filename>' no longer exists in the workspace (as shown below) then the artifact is missing from the server's workspace. This can occur for the following reasons:
- The files were manually deleted from the server's workspace.
- Your cleanup policy ran and it cleaned up artifacts on older builds.
- The file was registered as an artifact on a earlier stage of the build and it was then subsequently deleted from the server's workspace. Artifacts can be declared on any stage of the build but these registered artifacts must still be on the server once the build has completed.