[][src]Trait rusty_ci::buildsystem::BuildSystem

pub trait BuildSystem {
    fn preinstall(&mut self) -> Result<(), String> { ... }
fn install(&mut self) -> Result<(), String> { ... }
fn prebuild(&mut self) -> Result<(), String> { ... }
fn build(
        &mut self,
        master: MasterConfig,
        workers: Vec<Worker>
    ) -> Result<(), String> { ... }
fn start(&mut self, workers: &Vec<Worker>) -> Result<(), String> { ... }
fn start_master(&mut self) -> Result<(), String> { ... }
fn start_workers(&mut self, workers: &Vec<Worker>) -> Result<(), String> { ... }
fn create_workers(&mut self, workers: &Vec<Worker>) -> Result<(), String> { ... }
fn write_worker_configs(
        &mut self,
        workers: &Vec<Worker>
    ) -> Result<(), String> { ... }
fn create_master(&mut self) -> Result<(), String> { ... }
fn write_master_config(
        &mut self,
        master: &MasterConfig
    ) -> Result<(), String> { ... }
fn install_python(&mut self) -> Result<(), String> { ... }
fn install_buildbot(&mut self) -> Result<(), String> { ... } }

This trait describes how to build rusty-ci using a particular backend. For example, if you dont want to directly install the rusty-ci dependencies using the Cmd object as this trait defaults to, you can implement the trait for your type, and change the install method, similar to the BashBuildSystem implementation in this module.

Provided methods

fn preinstall(&mut self) -> Result<(), String>

Preinstall is called by the install method unless it is overloaded. This is usefult for printing a warning message or prompting the user before installing the dependencies for rusty-ci

fn install(&mut self) -> Result<(), String>

This method installs rusty-ci's dependencies, python3 and buildbot.

fn prebuild(&mut self) -> Result<(), String>

This method is similar to preinstall, but it is called by the build method instead of the install method

fn build(
    &mut self,
    master: MasterConfig,
    workers: Vec<Worker>
) -> Result<(), String>

fn start(&mut self, workers: &Vec<Worker>) -> Result<(), String>

This starts the master and the workers

fn start_master(&mut self) -> Result<(), String>

This method is used by the start method to spin up the master

fn start_workers(&mut self, workers: &Vec<Worker>) -> Result<(), String>

This method is used by the start method to spin up the workers

fn create_workers(&mut self, workers: &Vec<Worker>) -> Result<(), String>

Creates each worker in its proper directory

fn write_worker_configs(&mut self, workers: &Vec<Worker>) -> Result<(), String>

Writes the configuration buildbot.tac file for each worker

fn create_master(&mut self) -> Result<(), String>

Creates the master in the master directory

fn write_master_config(&mut self, master: &MasterConfig) -> Result<(), String>

Writes the master configuration file

fn install_python(&mut self) -> Result<(), String>

This method installs Python. You probably do need to overload this, I dont know for sure if it completely works. The bash impl of the buildsystem is the most reliable for now.

fn install_buildbot(&mut self) -> Result<(), String>

This method installs buildbot. Again, you probably want to overload this because it does not use a Python virtual environment, or venv. The venv is important because it does not modify the system wide packages.

Loading content...

Implementors

impl BuildSystem for BashBuildSystem[src]

fn install(&mut self) -> Result<(), String>[src]

Writes install script to install.sh for user to run

fn prebuild(&mut self) -> Result<(), String>[src]

Prompts user to confirm they've already ran the install subcommand

fn preinstall(&mut self) -> Result<(), String>[src]

fn build(
    &mut self,
    master: MasterConfig,
    workers: Vec<Worker>
) -> Result<(), String>
[src]

fn start(&mut self, workers: &Vec<Worker>) -> Result<(), String>[src]

fn start_master(&mut self) -> Result<(), String>[src]

fn start_workers(&mut self, workers: &Vec<Worker>) -> Result<(), String>[src]

fn create_workers(&mut self, workers: &Vec<Worker>) -> Result<(), String>[src]

fn write_worker_configs(&mut self, workers: &Vec<Worker>) -> Result<(), String>[src]

fn create_master(&mut self) -> Result<(), String>[src]

fn write_master_config(&mut self, master: &MasterConfig) -> Result<(), String>[src]

impl BuildSystem for DefaultBuildSystem[src]

fn preinstall(&mut self) -> Result<(), String>[src]

fn install(&mut self) -> Result<(), String>[src]

fn prebuild(&mut self) -> Result<(), String>[src]

fn build(
    &mut self,
    master: MasterConfig,
    workers: Vec<Worker>
) -> Result<(), String>
[src]

fn start(&mut self, workers: &Vec<Worker>) -> Result<(), String>[src]

fn start_master(&mut self) -> Result<(), String>[src]

fn start_workers(&mut self, workers: &Vec<Worker>) -> Result<(), String>[src]

fn create_workers(&mut self, workers: &Vec<Worker>) -> Result<(), String>[src]

fn write_worker_configs(&mut self, workers: &Vec<Worker>) -> Result<(), String>[src]

fn create_master(&mut self) -> Result<(), String>[src]

fn write_master_config(&mut self, master: &MasterConfig) -> Result<(), String>[src]

fn install_python(&mut self) -> Result<(), String>[src]

fn install_buildbot(&mut self) -> Result<(), String>[src]

Loading content...