Artifact
Artifacts can be used to represent data created as a side-effect of running
a Jenkins build.
Artifacts are files which are associated with a single build. A build can
have any number of artifacts associated with it.
This module provides a class called Artifact which allows you to download
objects from the server and also access them as a stream.
-
class jenkinsapi.artifact.Artifact(filename: str, url: str, build: Build, relative_path: str | None = None)[source]
Bases: object
Represents a single Jenkins artifact, usually some kind of file
generated as a by-product of executing a Jenkins build.
-
get_data() → Any[source]
Grab the text of the artifact
-
get_jenkins_obj() → Jenkins[source]
-
save(fspath: str, strict_validation: bool = False) → str[source]
Save the artifact to an explicit path. The containing directory must
exist. Returns a reference to the file which has just been writen to.
- Parameters:
fspath – full pathname including the filename, str
- Returns:
filepath
-
save_to_dir(dirpath: str, strict_validation: bool = False) → str[source]
Save the artifact to a folder. The containing directory must exist,
but use the artifact’s default filename.