View Source Dagger.Directory (dagger v0.8.7)

A directory.

Link to this section Summary

Functions

Gets the difference between this directory and an another directory.

Retrieves a directory at the given path.

Builds a new Docker container from this directory.

Returns a list of files and directories at the given path.

Writes the contents of the directory to a path on the host.

Retrieves a file at the given path.

The content-addressed identifier of the directory.

Creates a named sub-pipeline

Force evaluation in the engine.

Retrieves this directory plus a directory written at the given path.

Retrieves this directory plus the contents of the given file copied to the given path.

Retrieves this directory plus a new directory created at the given path.

Retrieves this directory plus a new file written at the given path.

Retrieves this directory with all file/dir timestamps set to the given time.

Retrieves this directory with the directory at the given path removed.

Retrieves this directory with the file at the given path removed.

Link to this section Types

@type t() :: %Dagger.Directory{client: term(), selection: term()}

Link to this section Functions

@spec diff(t(), t()) :: t()

Gets the difference between this directory and an another directory.

required-arguments

Required Arguments

  • other - Identifier of the directory to compare.
Link to this function

directory(directory, path)

View Source
@spec directory(t(), Dagger.String.t()) :: t()

Retrieves a directory at the given path.

required-arguments

Required Arguments

  • path - Location of the directory to retrieve (e.g., "/src").
Link to this function

docker_build(directory, optional_args \\ [])

View Source
@spec docker_build(
  t(),
  keyword()
) :: Dagger.Container.t()

Builds a new Docker container from this directory.

optional-arguments

Optional Arguments

  • dockerfile - Path to the Dockerfile to use (e.g., "frontend.Dockerfile").

Defaults: './Dockerfile'.

  • platform - The platform to build.
  • build_args - Build arguments to use in the build.
  • target - Target build stage to build.
  • secrets - Secrets to pass to the build.

They will be mounted at /run/secrets/[secret-name].

Link to this function

entries(directory, optional_args \\ [])

View Source
@spec entries(
  t(),
  keyword()
) :: {:ok, [Dagger.String.t()]} | {:error, term()}

Returns a list of files and directories at the given path.

optional-arguments

Optional Arguments

  • path - Location of the directory to look at (e.g., "/src").
@spec export(t(), Dagger.String.t()) :: {:ok, Dagger.Boolean.t()} | {:error, term()}

Writes the contents of the directory to a path on the host.

required-arguments

Required Arguments

  • path - Location of the copied directory (e.g., "logs/").
@spec file(t(), Dagger.String.t()) :: Dagger.File.t()

Retrieves a file at the given path.

required-arguments

Required Arguments

  • path - Location of the file to retrieve (e.g., "README.md").
@spec id(t()) :: {:ok, Dagger.DirectoryID.t()} | {:error, term()}

The content-addressed identifier of the directory.

Link to this function

pipeline(directory, name, optional_args \\ [])

View Source
@spec pipeline(t(), Dagger.String.t(), keyword()) :: t()

Creates a named sub-pipeline

required-arguments

Required Arguments

  • name - Pipeline name.

optional-arguments

Optional Arguments

  • description - Pipeline description.
  • labels - Pipeline labels.
@spec sync(t()) :: {:ok, Dagger.DirectoryID.t()} | {:error, term()}

Force evaluation in the engine.

Link to this function

with_directory(directory, path, directory, optional_args \\ [])

View Source
@spec with_directory(t(), Dagger.String.t(), t(), keyword()) :: t()

Retrieves this directory plus a directory written at the given path.

required-arguments

Required Arguments

  • path - Location of the written directory (e.g., "/src/").
  • directory - Identifier of the directory to copy.

optional-arguments

Optional Arguments

  • exclude - Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
  • include - Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
Link to this function

with_file(directory, path, source, optional_args \\ [])

View Source
@spec with_file(t(), Dagger.String.t(), Dagger.File.t(), keyword()) :: t()

Retrieves this directory plus the contents of the given file copied to the given path.

required-arguments

Required Arguments

  • path - Location of the copied file (e.g., "/file.txt").
  • source - Identifier of the file to copy.

optional-arguments

Optional Arguments

  • permissions - Permission given to the copied file (e.g., 0600).

Default: 0644.

Link to this function

with_new_directory(directory, path, optional_args \\ [])

View Source
@spec with_new_directory(t(), Dagger.String.t(), keyword()) :: t()

Retrieves this directory plus a new directory created at the given path.

required-arguments

Required Arguments

  • path - Location of the directory created (e.g., "/logs").

optional-arguments

Optional Arguments

  • permissions - Permission granted to the created directory (e.g., 0777).

Default: 0755.

Link to this function

with_new_file(directory, path, contents, optional_args \\ [])

View Source
@spec with_new_file(t(), Dagger.String.t(), Dagger.String.t(), keyword()) :: t()

Retrieves this directory plus a new file written at the given path.

required-arguments

Required Arguments

  • path - Location of the written file (e.g., "/file.txt").
  • contents - Content of the written file (e.g., "Hello world!").

optional-arguments

Optional Arguments

  • permissions - Permission given to the copied file (e.g., 0600).

Default: 0644.

Link to this function

with_timestamps(directory, timestamp)

View Source
@spec with_timestamps(t(), Dagger.Int.t()) :: t()

Retrieves this directory with all file/dir timestamps set to the given time.

required-arguments

Required Arguments

  • timestamp - Timestamp to set dir/files in.

Formatted in seconds following Unix epoch (e.g., 1672531199).

Link to this function

without_directory(directory, path)

View Source
@spec without_directory(t(), Dagger.String.t()) :: t()

Retrieves this directory with the directory at the given path removed.

required-arguments

Required Arguments

  • path - Location of the directory to remove (e.g., ".github/").
Link to this function

without_file(directory, path)

View Source
@spec without_file(t(), Dagger.String.t()) :: t()

Retrieves this directory with the file at the given path removed.

required-arguments

Required Arguments

  • path - Location of the file to remove (e.g., "/file.txt").