pub struct StackConfigBuilder { /* private fields */ }
Expand description
Builder for StackConfig
.
Implementations§
Source§impl StackConfigBuilder
impl StackConfigBuilder
Sourcepub fn project_name(&mut self, value: String) -> &mut Self
pub fn project_name(&mut self, value: String) -> &mut Self
Optionally specify a custom project name for the stack.
If this is empty string, it will default to the stack name.
Used with docker compose -p {project_name}
.
Note. Can be used to import pre-existing stacks.
Sourcepub fn run_directory(&mut self, value: String) -> &mut Self
pub fn run_directory(&mut self, value: String) -> &mut Self
Directory to change to (cd
) before running docker compose up -d
.
Default: ./
(the repo root)
Sourcepub fn file_paths(&mut self, value: Vec<String>) -> &mut Self
pub fn file_paths(&mut self, value: Vec<String>) -> &mut Self
Add paths to compose files, relative to the run path.
If this is empty, will use file compose.yaml
.
Sourcepub fn files_on_host(&mut self, value: bool) -> &mut Self
pub fn files_on_host(&mut self, value: bool) -> &mut Self
If this is checked, the stack will source the files on the host.
Use run_directory
and file_paths
to specify the path on the host.
This is useful for those who wish to setup their files on the host using SSH or similar,
rather than defining the contents in UI or in a git repo.
Sourcepub fn registry_provider(&mut self, value: String) -> &mut Self
pub fn registry_provider(&mut self, value: String) -> &mut Self
Used with registry_account
to login to a registry before docker compose up.
Sourcepub fn registry_account(&mut self, value: String) -> &mut Self
pub fn registry_account(&mut self, value: String) -> &mut Self
Used with registry_provider
to login to a registry before docker compose up.
Sourcepub fn extra_args(&mut self, value: Vec<String>) -> &mut Self
pub fn extra_args(&mut self, value: Vec<String>) -> &mut Self
The extra arguments to pass after docker compose up -d
.
If empty, no extra arguments will be passed.
Sourcepub fn environment(&mut self, value: Vec<EnvironmentVar>) -> &mut Self
pub fn environment(&mut self, value: Vec<EnvironmentVar>) -> &mut Self
The environment variables passed to the compose file. They will be written to path defined in env_file_path, which is given relative to the run directory.
If it is empty, no file will be written.
Sourcepub fn env_file_path(&mut self, value: String) -> &mut Self
pub fn env_file_path(&mut self, value: String) -> &mut Self
The name of the written environment file before docker compose up
.
Relative to the repo root.
Default: .env
Sourcepub fn skip_secret_interp(&mut self, value: bool) -> &mut Self
pub fn skip_secret_interp(&mut self, value: bool) -> &mut Self
Whether to skip secret interpolation into the stack environment variables.
Sourcepub fn file_contents(&mut self, value: String) -> &mut Self
pub fn file_contents(&mut self, value: String) -> &mut Self
The contents of the file directly, for management in the UI. If this is empty, it will fall back to checking git config for repo based compose file.
Sourcepub fn ignore_services(&mut self, value: Vec<String>) -> &mut Self
pub fn ignore_services(&mut self, value: Vec<String>) -> &mut Self
Ignore certain services declared in the compose file when checking
the stack status. For example, an init service might be exited, but the
stack should be healthy. This init service should be in ignore_services
Sourcepub fn git_provider(&mut self, value: String) -> &mut Self
pub fn git_provider(&mut self, value: String) -> &mut Self
The git provider domain. Default: github.com
Sourcepub fn git_https(&mut self, value: bool) -> &mut Self
pub fn git_https(&mut self, value: bool) -> &mut Self
Whether to use https to clone the repo (versus http). Default: true
Note. Monitor does not currently support cloning repos via ssh.
Sourcepub fn git_account(&mut self, value: String) -> &mut Self
pub fn git_account(&mut self, value: String) -> &mut Self
The git account used to access private repos. Passing empty string can only clone public repos.
Note. A token for the account must be available in the core config or the builder server’s periphery config for the configured git provider.
Sourcepub fn repo(&mut self, value: String) -> &mut Self
pub fn repo(&mut self, value: String) -> &mut Self
The Github repo used as the source of the build.
Sourcepub fn webhook_enabled(&mut self, value: bool) -> &mut Self
pub fn webhook_enabled(&mut self, value: bool) -> &mut Self
Whether incoming webhooks actually trigger action.
Sourcepub fn webhook_secret(&mut self, value: String) -> &mut Self
pub fn webhook_secret(&mut self, value: String) -> &mut Self
Optionally provide an alternate webhook secret for this stack. If its an empty string, use the default secret from the config.
Sourcepub fn send_alerts(&mut self, value: bool) -> &mut Self
pub fn send_alerts(&mut self, value: bool) -> &mut Self
Whether to send StackStateChange alerts for this stack.
Sourcepub fn build(&self) -> Result<StackConfig, StackConfigBuilderError>
pub fn build(&self) -> Result<StackConfig, StackConfigBuilderError>
Trait Implementations§
Source§impl Clone for StackConfigBuilder
impl Clone for StackConfigBuilder
Source§fn clone(&self) -> StackConfigBuilder
fn clone(&self) -> StackConfigBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for StackConfigBuilder
impl RefUnwindSafe for StackConfigBuilder
impl Send for StackConfigBuilder
impl Sync for StackConfigBuilder
impl Unpin for StackConfigBuilder
impl UnwindSafe for StackConfigBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.