testcontainers-build 0.1.0

Build Testcontainers images from folders, remote contexts, and pluggable Git providers
Documentation
/// Select a Git repository and build subdirectory.
/// Use a commit ID for repeatable builds.
#[derive(Debug, Clone)]
pub struct GitRequest {
    /// Set the Git repository URL or local path.
    /// The selected Git provider resolves it.
    pub repository: String,
    /// Set a branch, tag, or commit ID.
    /// The default is HEAD.
    pub revision: String,
    /// Set the build subdirectory.
    /// Use a path relative to the checkout root.
    pub subdirectory: String,
}

impl GitRequest {
    /// Select a branch, tag, or commit ID.
    /// Use a full commit ID for repeatable builds.
    pub fn with_revision(mut self, revision: impl Into<String>) -> Self {
        self.revision = revision.into();
        self
    }

    /// Select the build subdirectory within the checkout.
    /// Use forward slashes and no parent traversal.
    pub fn with_subdirectory(mut self, subdirectory: impl Into<String>) -> Self {
        self.subdirectory = subdirectory.into();
        self
    }

    /// Select a repository.
    /// Use HEAD and the checkout root by default.
    pub fn new(repository: impl Into<String>) -> Self {
        Self {
            repository: repository.into(),
            revision: "HEAD".into(),
            subdirectory: ".".into(),
        }
    }
}