Skip to main content

export_circleci

Function export_circleci 

Source
pub fn export_circleci(
    session: &Session,
    params: Option<&[Parameter]>,
) -> String
Expand description

Export a session as a CircleCI configuration YAML.

Generates a .circleci/config.yml with:

  • Metadata header comments (session name, date, command count)
  • Version 2.1 config
  • Single build job using cimg/base:current Docker image
  • environment: block when parameters are provided
  • Checkout step followed by expanded run: steps
  • working_directory on every step
  • workflows section at the end
  • Annotations for failed commands (non-zero exit codes)

When params is Some, an environment: block is added at job level and commands use $VAR references.

Empty sessions produce a valid config with a “No commands recorded” comment.