pipelight/workflow
2024-01-10 17:06:00 +01:00
..
src add early error message on untriggerable pipelines 2024-01-10 17:06:00 +01:00
Cargo.toml add pipeline level options to set if should_detach from stio 2023-11-29 16:29:44 +01:00
README.md exec clean process crate 2023-09-26 17:04:14 +02:00

Pipeline crate

What is inside ?

The pipeline crate is the biggest crate of the project. Where all the magic happens.

Getters

Contain getters for config, pipelines

Config

Without a config file pipeline can only read logs.

Getting a config file is nearly mandatory.

Internally Config::get() will search for a config file return it if founded,

  • create git hooks if the file is at the root of a git directory.
  • create log folders.

Cli crate

What is inside ?

Here lays everything related to the cli.

  • Commands definitions(interface directory)

  • The actions to take on commands and options (action.rs)

  • Autocompletion script generator (not mensionned in doc yet)

  • Special: Traits to convert the clap.rs cli Commands back to original strings.

  • Special: Process self forking strategy

Process self-fork to background

It involved some imagination in its inner design, for the Pipeplight executable to be align with the following requirements:

  • keep runing in the background when terminal close;
  • and remain a single executable to preserve types concistency.

This crate implements the most tricky part of Pipelight core.

When a command is launched pipelight run my_pipe some things happened under the hood.

  1. The pipelight executable runs and check the command in the foreground.
  2. The executable duplicate itself to run a secondary executable in the backround.
  3. The foreground executable dies.
  4. The backround executable keeps running detached from terminal.