Treatment stepOnCached
cicd/steps::stepOnCached
Configuration
⬡ runner: cicd/runners::CicdRunnerEngine
Parameters
↳ var artifacts: Vec<Artifact> = [] (cicd/artifact::Artifact)
↳ var cache: Option<Cache> = _ (cicd/cache::Cache)
↳ var commands: Vec<Command> = [] (process/command::Command)
↳ var environment: Option<Environment> = _ (process/environment::Environment)
↳ var executor_name: Option<string> = _
↳ var name: string
↳ var out_file: Option<string> = _
↳ var out_filesystem: Option<string> = _
↳ var stop_on_failure: bool = true
Inputs
⇥ cache_name: Block<string>
⇥ trigger: Block<void>
Outputs
↦ completed: Block<void>
↦ data: Stream<byte>
↦ error: Block<void>
↦ failed: Block<void>
↦ finished: Block<void>
↦ started: Block<void>
↦ success: Block<void>
Runs step on given runner, caching under a name received.
Uses the runner to run given commands on executor designated by executor_name with environment.
name serves as identifying purpose.
After commands run, and if they all succeed, the out_file from out_filesystem is extracted and streamed through data.
About the outputs signals:
startedis emitted once first command is started;finishedis emitted once execution of commands ends in any case;failedis emitted if executor failed to run commands (no further commands are executed);completedis emitted once and if commands runs to completion;successis emitted if commands run successfully, returning exit code0;erroris emitted if commands run exited with exit code different from0.
With a cache (see cicd/cache::|cache), its directory is restored from api.melodium.tech before commands run, and saved once they succeed, under the name received through cache_name, such as one computed from the content of a lock file.
A missed cache and a cache that cannot be saved only log warnings.
With artifacts (see cicd/artifact::|artifact), each is pushed to api.melodium.tech as a run artifact once commands succeed, before the step finishes; an artifact that cannot be pushed only logs a warning.
ℹ️ commands can be empty, as well as environment and executor_name set to none, making stepOn to directly extract out_file from out_filesystem.
out_file and out_filesystem can be none and data stream will be closed without emitting reading error.
⚠️ environment may rely on the executor abilities to be correctly setted up. Within containers it is usually passed to /usr/bin/env command, which then require it to be present to use specific environment.
Also, while present in many base images, abilities of /usr/bin/env may be limited. Distributions such as Alpine Linux includes a basic env command unable to set working directory, requiring to run apk add coreutils-env beforehand if working_directory of given environment is used.