dagger/dsl/directory

Types

pub type Opts {
  Opts(
    source_root_path: option.Option(String),
    dockerfile: option.Option(String),
    platform: option.Option(String),
    build_args: option.Option(List(types.BuildArg)),
    target: option.Option(String),
    secrets: option.Option(List(types.Secret)),
    no_init: option.Option(Bool),
    ssh: option.Option(types.Socket),
    path: option.Option(String),
    expected_type: option.Option(types.ExistsType),
    do_not_follow_symlinks: option.Option(Bool),
    wipe: option.Option(Bool),
    exclude: option.Option(List(String)),
    include: option.Option(List(String)),
    gitignore: option.Option(Bool),
    paths: option.Option(List(String)),
    globs: option.Option(List(String)),
    literal: option.Option(Bool),
    multiline: option.Option(Bool),
    dotall: option.Option(Bool),
    insensitive: option.Option(Bool),
    skip_ignored: option.Option(Bool),
    skip_hidden: option.Option(Bool),
    files_only: option.Option(Bool),
    limit: option.Option(Int),
    container: option.Option(types.Container),
    cmd: option.Option(List(String)),
    experimental_privileged_nesting: option.Option(Bool),
    insecure_root_capabilities: option.Option(Bool),
    owner: option.Option(String),
    permissions: option.Option(Int),
  )
}

Constructors

Values

pub fn as_git(parent: types.Directory) -> types.GitRepository

Converts this directory to a local git repository

pub fn as_module(
  parent: types.Directory,
  with with_fn: fn(Opts) -> Opts,
) -> types.Module

Load the directory as a Dagger module source

pub fn as_module_source(
  parent: types.Directory,
  with with_fn: fn(Opts) -> Opts,
) -> types.ModuleSource

Load the directory as a Dagger module source

pub fn build_args(opts: Opts, val: List(types.BuildArg)) -> Opts
pub fn changes(
  parent: types.Directory,
  from from: types.Directory,
) -> types.Changeset

Return the difference between this directory and another directory, typically an older snapshot. The difference is encoded as a changeset, which also tracks removed files, and can be applied to other directories.

pub fn chown(
  parent: types.Directory,
  path path: String,
  owner owner: String,
) -> types.Directory

Change the owner of the directory contents recursively.

pub fn cmd(opts: Opts, val: List(String)) -> Opts
pub fn container(opts: Opts, val: types.Container) -> Opts
pub fn diff(
  parent: types.Directory,
  other other: types.Directory,
) -> types.Directory

Return the difference between this directory and an another directory. The difference is encoded as a directory.

pub fn digest(
  parent: types.Directory,
  client client: types.Client,
  then handler: fn(Result(String, types.QueryError)) -> a,
) -> a

Return the directory’s digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.

pub fn directory() -> types.Directory
pub fn do_not_follow_symlinks(opts: Opts, val: Bool) -> Opts
pub fn docker_build(
  parent: types.Directory,
  with with_fn: fn(Opts) -> Opts,
) -> types.Container

Use Dockerfile compatibility to build a container from this directory. Only use this function for Dockerfile compatibility. Otherwise use the native Container type directly, it is feature-complete and supports all Dockerfile features.

pub fn dockerfile(opts: Opts, val: String) -> Opts
pub fn dotall(opts: Opts, val: Bool) -> Opts
pub fn entries(
  parent: types.Directory,
  with with_fn: fn(Opts) -> Opts,
  client client: types.Client,
  then handler: fn(Result(List(String), types.QueryError)) -> a,
) -> a

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

pub fn exclude(opts: Opts, val: List(String)) -> Opts
pub fn exists(
  parent: types.Directory,
  path path: String,
  with with_fn: fn(Opts) -> Opts,
  client client: types.Client,
  then handler: fn(Result(Bool, types.QueryError)) -> a,
) -> a

check if a file or directory exists

pub fn expected_type(opts: Opts, val: types.ExistsType) -> Opts
pub fn experimental_privileged_nesting(
  opts: Opts,
  val: Bool,
) -> Opts
pub fn export(
  parent: types.Directory,
  path path: String,
  with with_fn: fn(Opts) -> Opts,
  client client: types.Client,
  then handler: fn(Result(String, types.QueryError)) -> a,
) -> a

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

pub fn file(
  parent: types.Directory,
  path path: String,
) -> types.File

Retrieve a file at the given path.

pub fn files_only(opts: Opts, val: Bool) -> Opts
pub fn filter(
  parent: types.Directory,
  with with_fn: fn(Opts) -> Opts,
) -> types.Directory

Return a snapshot with some paths included or excluded

pub fn find_up(
  parent: types.Directory,
  name name: String,
  start start: String,
  client client: types.Client,
  then handler: fn(Result(String, types.QueryError)) -> a,
) -> a

Search up the directory tree for a file or directory, and return its path. If no match, return null

pub fn gitignore(opts: Opts, val: Bool) -> Opts
pub fn glob(
  parent: types.Directory,
  pattern pattern: String,
  client client: types.Client,
  then handler: fn(Result(List(String), types.QueryError)) -> a,
) -> a

Returns a list of files and directories that matche the given pattern.

pub fn globs(opts: Opts, val: List(String)) -> Opts
pub fn id(parent: types.Directory) -> types.Directory

A unique identifier for this Directory.

pub fn include(opts: Opts, val: List(String)) -> Opts
pub fn insecure_root_capabilities(opts: Opts, val: Bool) -> Opts
pub fn insensitive(opts: Opts, val: Bool) -> Opts
pub fn limit(opts: Opts, val: Int) -> Opts
pub fn literal(opts: Opts, val: Bool) -> Opts
pub fn multiline(opts: Opts, val: Bool) -> Opts
pub fn name(
  parent: types.Directory,
  client client: types.Client,
  then handler: fn(Result(String, types.QueryError)) -> a,
) -> a

Returns the name of the directory.

pub fn no_init(opts: Opts, val: Bool) -> Opts
pub fn none(opts: Opts) -> Opts
pub fn owner(opts: Opts, val: String) -> Opts
pub fn path(opts: Opts, val: String) -> Opts
pub fn paths(opts: Opts, val: List(String)) -> Opts
pub fn permissions(opts: Opts, val: Int) -> Opts
pub fn platform(opts: Opts, val: String) -> Opts
pub fn search(
  parent: types.Directory,
  pattern pattern: String,
  with with_fn: fn(Opts) -> Opts,
  select select: fn(types.SearchResult) -> List(types.Field),
  client client: types.Client,
  then handler: fn(
    Result(List(types.SearchResult), types.QueryError),
  ) -> a,
) -> a

Searches for content matching the given regular expression or literal string. Uses Rust regex syntax; escape literal ., [, ], {, }, | with backslashes.

pub fn secrets(opts: Opts, val: List(types.Secret)) -> Opts
pub fn skip_hidden(opts: Opts, val: Bool) -> Opts
pub fn skip_ignored(opts: Opts, val: Bool) -> Opts
pub fn source_root_path(opts: Opts, val: String) -> Opts
pub fn ssh(opts: Opts, val: types.Socket) -> Opts
pub fn stat(
  parent: types.Directory,
  path path: String,
  with with_fn: fn(Opts) -> Opts,
) -> types.Stat

Return file status

pub fn sync(parent: types.Directory) -> types.Directory

Force evaluation in the engine.

pub fn target(opts: Opts, val: String) -> Opts
pub fn terminal(
  parent: types.Directory,
  with with_fn: fn(Opts) -> Opts,
) -> types.Directory

Opens an interactive terminal in new container with this directory mounted inside.

pub fn wipe(opts: Opts, val: Bool) -> Opts
pub fn with_changes(
  parent: types.Directory,
  changes changes: types.Changeset,
) -> types.Directory

Return a directory with changes from another directory applied to it.

pub fn with_directory(
  parent: types.Directory,
  path path: String,
  source source: types.Directory,
  with with_fn: fn(Opts) -> Opts,
) -> types.Directory

Return a snapshot with a directory added

pub fn with_error(
  parent: types.Directory,
  err err: String,
) -> types.Directory

Raise an error.

pub fn with_file(
  parent: types.Directory,
  path path: String,
  source source: types.File,
  with with_fn: fn(Opts) -> Opts,
) -> types.Directory

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

pub fn with_files(
  parent: types.Directory,
  path path: String,
  sources sources: List(types.File),
  with with_fn: fn(Opts) -> Opts,
) -> types.Directory

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

pub fn with_new_directory(
  parent: types.Directory,
  path path: String,
  with with_fn: fn(Opts) -> Opts,
) -> types.Directory

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

pub fn with_new_file(
  parent: types.Directory,
  path path: String,
  contents contents: String,
  with with_fn: fn(Opts) -> Opts,
) -> types.Directory

Return a snapshot with a new file added

pub fn with_patch(
  parent: types.Directory,
  patch patch: String,
) -> types.Directory

Retrieves this directory with the given Git-compatible patch applied.

pub fn with_patch_file(
  parent: types.Directory,
  patch patch: types.File,
) -> types.Directory

Retrieves this directory with the given Git-compatible patch file applied.

pub fn with_symlink(
  parent: types.Directory,
  target target: String,
  link_name link_name: String,
) -> types.Directory

Return a snapshot with a symlink

pub fn with_timestamps(
  parent: types.Directory,
  timestamp timestamp: Int,
) -> types.Directory

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

pub fn without_directory(
  parent: types.Directory,
  path path: String,
) -> types.Directory

Return a snapshot with a subdirectory removed

pub fn without_file(
  parent: types.Directory,
  path path: String,
) -> types.Directory

Return a snapshot with a file removed

pub fn without_files(
  parent: types.Directory,
  paths paths: List(String),
) -> types.Directory

Return a snapshot with files removed

Search Document