Skip to content

Extract Artifacts Root path out of Artifacts path #822

@YevgeniyShunevych

Description

@YevgeniyShunevych

Before the v3, Artifacts path was an absolute path to AtataContext artifacts.
Now Artifacts path is split into 2 parts, basically it becomes a path relative to Artifacts Root.

Default Artifacts Root path is "{basedir}/artifacts/{build-start:yyyyMMddTHHmmss}".
Default Artifacts path is "{test-suite-name-sanitized:/*}{test-name-sanitized:/*}".

ArtifactsRoot properties and methods are located in AtataContext.GlobalProperties:

/// <summary>
/// Gets or sets the Artifacts Root path template.
/// The default value is <c>"{basedir}/artifacts/{build-start:yyyyMMddTHHmmss}"</c>.
/// </summary>
public string ArtifactsRootPathTemplate { get; set; }

/// <summary>
/// Gets the <see cref="DirectorySubject"/> of Artifacts Root directory.
/// <see cref="ArtifactsRootPathTemplate"/> property is used to configure the Artifacts Root path.
/// </summary>
public DirectorySubject ArtifactsRoot { get; }

/// <summary>
/// Gets the path of Artifacts Root directory.
/// <see cref="ArtifactsRootPathTemplate"/> property is used to configure the Artifacts Root path.
/// </summary>
public string ArtifactsRootPath { get; }

/// <summary>
/// <para>
/// Sets the path template of the Artifacts Root directory.
/// The default value is <c>"{basedir}/artifacts/{build-start:yyyyMMddTHHmmss}"</c>.
/// </para>
/// <para>
/// The list of supported variables:
/// </para>
/// <list type="bullet">
/// <item><c>{basedir}</c></item>
/// <item><c>{build-start}</c></item>
/// <item><c>{build-start-utc}</c></item>
/// </list>
/// </summary>
/// <param name="directoryPathTemplate">The directory path template.</param>
/// <returns>The same <see cref="AtataContextGlobalProperties"/> instance.</returns>
public AtataContextGlobalProperties UseArtifactsRootPathTemplate(string directoryPathTemplate);

/// <summary>
/// Sets the default Artifacts root path template with optionally
/// including <c>"{build-start:yyyyMMddTHHmmss}"</c> folder in the path.
/// </summary>
/// <param name="include">Whether to include the <c>"{build-start:yyyyMMddTHHmmss}"</c> folder in the path.</param>
/// <returns>The same <see cref="AtataContextGlobalProperties"/> instance.</returns>
public AtataContextGlobalProperties UseDefaultArtifactsRootPathTemplateIncludingBuildStart(bool include);

Removed AtataContextBuilder Artifacts configuration methods:

public AtataContextBuilder UseArtifactsPath(string directoryPath);

public AtataContextBuilder UseArtifactsPath(Func<AtataContext, string> directoryPathBuilder);

public AtataContextBuilder UseDefaultArtifactsPathIncludingBuildStart(bool include);

New AtataContextBuilder Artifacts configuration method:

public AtataContextBuilder UseArtifactsPathTemplate(string directoryPathTemplate);

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions