GitLab CI Kotlin DSL • opensavvy.gitlab.ci • Artifacts
Artifacts¶
class Artifacts : YamlExport
Configures job artifacts that are attached to the job when it succeeds, fails, or always.
Job artifacts are a list of files and directories that are sent to GitLab after the job finishes. They are available for download in the GitLab UI if the size is smaller than the maximum artifact size. By default, jobs in later stages automatically download all the artifacts created by jobs in earlier stages.
Example¶
val build by job {
script {
shell("make build")
}
artifacts {
include("binaries/")
include(".config")
expireIn("1 week")
}
}
External resources¶
Constructors¶
Artifacts
¶
constructor()
Functions¶
accessibility
¶
fun accessibility(path: String)
Collects accessibility test reports using pa11y to report on the accessibility impact of changes.
annotations
¶
fun annotations(path: String)
Collects annotations to attach auxiliary data to a job.
apiFuzzing
¶
fun apiFuzzing(path: String)
Collects API fuzzing security test reports.
browserPerformance
¶
fun browserPerformance(path: String)
Collects browser performance test reports.
clusterImageScanning
¶
fun clusterImageScanning(path: String)
Collects cluster image scanning security reports.
codeQuality
¶
fun codeQuality(path: String)
Collects code quality reports to display code quality information in GitLab.
containerScanning
¶
fun containerScanning(path: String)
Collects container scanning security reports.
coverage
¶
Collects code coverage reports in Cobertura or JaCoCo formats.
coverageFuzzing
¶
fun coverageFuzzing(path: String)
Collects coverage fuzzing security test reports.
cyclonedx
¶
Collects CycloneDX software bill of materials (SBOM) reports.
dast
¶
Collects Dynamic Application Security Testing (DAST) reports.
dependencyScanning
¶
fun dependencyScanning(path: String)
Collects dependency scanning security reports.
dotenv
¶
Collects environment variables from a dotenv file to pass to downstream jobs.
exclude
¶
Prevents files from being added to the artifacts archive.
expireIn
¶
Specifies how long job artifacts are stored before they expire and are deleted.
exposeAs
¶
Exposes job artifacts in the merge request UI with a custom display name.
include
¶
Specifies which files to save as job artifacts.
junit
¶
Collects JUnit test reports to display test results in GitLab's UI.
licenseScanning
¶
fun licenseScanning(path: String)
Collects license scanning reports.
loadPerformance
¶
fun loadPerformance(path: String)
Collects load performance test reports.
metrics
¶
Collects metrics reports.
name
¶
Defines the name of the created artifacts archive.
requirements
¶
fun requirements(path: String)
Collects requirements reports.
rule
¶
Specifies when to upload artifacts based on job result.
sast
¶
Collects Static Application Security Testing (SAST) reports.
secretDetection
¶
fun secretDetection(path: String)
Collects secret detection security reports.
terraform
¶
Collects Terraform plan reports.
toYaml
¶
Converts this object into a Yaml object.