[−][src]Struct cage::Project
A cage
project, which is represented as a directory containing a
pods
subdirectory.
Implementations
impl Project
[src]
pub fn from_current_dir() -> Result<Project>
[src]
Create a Project
using the pre-existing project files in the
current directory as input and the .cage
subdirectory as
output.
pub fn name(&self) -> &str
[src]
The name of this project. This defaults to the name of the current directory.
pub fn set_name(&mut self, name: &str) -> &mut Project
[src]
Set the name of this project. This should be done before calling
output
or any methods in cmd
.
pub fn compose_name(&self) -> String
[src]
Get that name that docker_compose
would use for this project.
pub fn root_dir(&self) -> &Path
[src]
The root directory of this project.
pub fn src_dir(&self) -> &Path
[src]
The source directory of this project, where we can put cloned git repositories, and where our local source trees are typically found.
pub fn output_dir(&self) -> &Path
[src]
The output directory of this project. Normally .cage
inside
the root_dir
, but it may be targetn.
pub fn pods_dir(&self) -> PathBuf
[src]
The directory in which are pods are defined, and relative to which
all docker-compose.yml
paths should be interpreted.
pub fn output_pods_dir(&self) -> PathBuf
[src]
The path relative to which our pods will be output. This can be
joined with Pod::rel_path
to get an output path for a specific pod.
pub fn pods(&self) -> Pods<'_>ⓘ
[src]
Iterate over all pods in this project.
pub fn pod(&self, name: &str) -> Option<&Pod>
[src]
Look up the named pod.
pub fn service<'a>(&self, name: &'a str) -> Option<(&Pod, &str)>
[src]
Look up the named service. Returns the pod containing the service and the name of the service within that pod.
pub fn service_or_err<'a>(&self, name: &'a str) -> Result<(&Pod, &str)>
[src]
Like service
, but returns an error if the service is unknown.
pub fn pod_or_service<'a, 'b>(
&'a self,
name: &'b str
) -> Option<PodOrService<'a>>
[src]
&'a self,
name: &'b str
) -> Option<PodOrService<'a>>
Look for a name as a pod first, and if that fails, look for it as a service.
pub fn pod_or_service_or_err<'a, 'b>(
&'a self,
name: &'b str
) -> Result<PodOrService<'a>>
[src]
&'a self,
name: &'b str
) -> Result<PodOrService<'a>>
Like pod_or_service
, but returns an error if no pod or service of
that name can be found.
pub fn targets(&self) -> Targets<'_>ⓘ
[src]
Iterate over all targets in this project.
pub fn target(&self, name: &str) -> Option<&Target>
[src]
Look up the named target. We name this function target
instead of
target
to avoid a keyword clash.
pub fn target_or_err(&self, name: &str) -> Result<&Target>
[src]
Like target
, but returns an error if no each target is found.
pub fn current_target(&self) -> &Target
[src]
Get the current target that we're using with this project.
pub fn set_current_target_name(&mut self, name: &str) -> Result<()>
[src]
Set the name of the target to use. This must be done before
calling output
or export
.
pub fn sources(&self) -> &Sources
[src]
Return the collection of source trees associated with this project, including both extern git repositories and local source trees.
pub fn sources_mut(&mut self) -> &mut Sources
[src]
Return the collection of source trees associated with this project in mutable form.
pub fn hooks(&self) -> &HookManager
[src]
Get our available hooks.
pub fn default_tags(&self) -> Option<&DefaultTags>
[src]
Get the default tags associated with this project, if any.
pub fn set_default_tags(&mut self, tags: DefaultTags) -> &mut Project
[src]
Set the default tags associated with this project.
pub fn plugins(&self) -> &Manager
[src]
Our plugin manager.
pub fn save_settings(&mut self) -> Result<()>
[src]
Save persistent project settings to disk.
pub fn enabled_pods_that_are_not_running(&self) -> Result<Vec<&Pod>>
[src]
Find all enabled pods which do not appear to be running.
pub fn output(&self, subcommand: &str) -> Result<()>
[src]
Delete our existing output and replace it with a processed and expanded version of our pod definitions.
pub fn export(&self, export_dir: &Path) -> Result<()>
[src]
Export this project (with the specified target applied) as a set
of standalone *.yml
files with no environment variable
interpolations and no external dependencies.
Trait Implementations
impl CommandCompose for Project
[src]
fn compose<CR>(
&self,
runner: &CR,
command: &str,
act_on: &ActOn,
opts: &dyn ToArgs
) -> Result<()> where
CR: CommandRunner,
[src]
&self,
runner: &CR,
command: &str,
act_on: &ActOn,
opts: &dyn ToArgs
) -> Result<()> where
CR: CommandRunner,
fn compose_pod<CR>(
&self,
runner: &CR,
command: &str,
pod: &Pod,
opts: &dyn ToArgs
) -> Result<()> where
CR: CommandRunner,
[src]
&self,
runner: &CR,
command: &str,
pod: &Pod,
opts: &dyn ToArgs
) -> Result<()> where
CR: CommandRunner,
fn compose_service<CR>(
&self,
runner: &CR,
command: &str,
pod: &Pod,
service_name: &str,
opts: &dyn ToArgs
) -> Result<()> where
CR: CommandRunner,
[src]
&self,
runner: &CR,
command: &str,
pod: &Pod,
service_name: &str,
opts: &dyn ToArgs
) -> Result<()> where
CR: CommandRunner,
impl CommandExec for Project
[src]
fn exec<CR>(
&self,
runner: &CR,
service_name: &str,
command: &Command,
opts: &Exec
) -> Result<()> where
CR: CommandRunner,
[src]
&self,
runner: &CR,
service_name: &str,
command: &Command,
opts: &Exec
) -> Result<()> where
CR: CommandRunner,
fn shell<CR>(&self, runner: &CR, service_name: &str, opts: &Exec) -> Result<()> where
CR: CommandRunner,
[src]
CR: CommandRunner,
impl CommandGenerate for Project
[src]
fn generate_new(parent_dir: &Path, name: &str) -> Result<PathBuf>
[src]
fn generate_list(&self) -> Result<()>
[src]
fn generate(&self, name: &str) -> Result<()>
[src]
impl CommandLogs for Project
[src]
fn logs<CR>(&self, runner: &CR, act_on: &ActOn, opts: &Logs) -> Result<()> where
CR: CommandRunner,
[src]
CR: CommandRunner,
impl CommandPull for Project
[src]
impl CommandRun for Project
[src]
fn run<CR>(
&self,
runner: &CR,
service: &str,
command: Option<&Command>,
opts: &Run
) -> Result<()> where
CR: CommandRunner,
[src]
&self,
runner: &CR,
service: &str,
command: Option<&Command>,
opts: &Run
) -> Result<()> where
CR: CommandRunner,
fn test<CR>(
&self,
runner: &CR,
service_name: &str,
command: Option<&Command>
) -> Result<()> where
CR: CommandRunner,
[src]
&self,
runner: &CR,
service_name: &str,
command: Option<&Command>
) -> Result<()> where
CR: CommandRunner,
impl CommandRunScript for Project
[src]
fn run_script<CR>(
&self,
runner: &CR,
act_on: &ActOn,
script_name: &str,
opts: &Run
) -> Result<()> where
CR: CommandRunner,
[src]
&self,
runner: &CR,
act_on: &ActOn,
script_name: &str,
opts: &Run
) -> Result<()> where
CR: CommandRunner,
impl CommandSource for Project
[src]
fn source_list<CR>(&self, _runner: &CR) -> Result<()> where
CR: CommandRunner,
[src]
CR: CommandRunner,
fn source_clone<CR>(&mut self, runner: &CR, alias: &str) -> Result<()> where
CR: CommandRunner,
[src]
CR: CommandRunner,
fn source_set_mounted<CR>(
&mut self,
runner: &CR,
acts_on_sources: ActOnSources,
mounted: bool
) -> Result<()> where
CR: CommandRunner,
[src]
&mut self,
runner: &CR,
acts_on_sources: ActOnSources,
mounted: bool
) -> Result<()> where
CR: CommandRunner,
impl CommandStatus for Project
[src]
impl CommandUp for Project
[src]
fn up<CR>(&self, runner: &CR, act_on: &ActOn, opts: &Up) -> Result<()> where
CR: CommandRunner,
[src]
CR: CommandRunner,
fn init_pod<CR>(&self, runner: &CR, pod: &Pod) -> Result<()> where
CR: CommandRunner,
[src]
CR: CommandRunner,
impl Debug for Project
[src]
impl Serialize for Project
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Project
impl !Send for Project
impl Sync for Project
impl Unpin for Project
impl !UnwindSafe for Project
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> GetTypeId for T where
T: Any,
T: Any,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Err = <U as TryFrom<T>>::Err
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Err>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,