Scroll to navigation

KAS-DUMP(1) kas KAS-DUMP(1)

NAME

kas-dump - kas dump plugin

SYNOPSIS

kas dump [-h] [--skip STEP] [--force-checkout] [--update]

[--format {yaml,json}] [--indent INDENT] [--resolve-refs]
[--resolve-local] [--resolve-env | --lock] [-i]
[config]


DESCRIPTION

Expand and dump the final config to stdout. when resolving branches, this is done before patches are applied.

This plugin implements the kas dump command.

When this command is executed in default mode, kas will parse all referenced config files, expand includes and print a flattened yaml version of the configuration to stdout. This config is semantically identical to the input, but does not include any references to other configuration files. The output of this command can be used to further analyse the build configuration.

When running with --lock, a locking spec is created which only contains the exact commit of each repository. This can be used to pin the commit of floating branches and tags, while still keeping an easy update path. When combining with --inplace, a lockfile is created next to the first file on the kas cmdline. For details on the locking support, see kas.includehandler.IncludeHandler.

When running with --resolve-local, VCS tracking information of the root repo (the one with the kas-project.yml) is added to the output. The generated file can be used as single input to kas to reproduce the build environment. If the root repo is not under version control or contains uncommitted changes, a warning is emitted.

Please note:

  • the dumped config is semantically identical but not bit-by-bit identical
  • all referenced repositories are checked out to resolve cross-repo configs
  • all branches are resolved before patches are applied

For example, to get a single config representing the final build config of kas-project.yml:target-override.yml you could run:

kas dump kas-project.yml:target-override.yml > kas-project-expanded.yml


The generated config can be used as input for kas:

kas build kas-project-expanded.yml


Example of the locking mechanism (call again to regenerate lockfile). The lockfile is created as kas-project.lock.yml:

kas dump --lock --inplace --update kas-project.yml


The generated lockfile will automatically be used to pin the revisions:

kas build kas-project.yml


Note, that the lockfiles should be checked-in into the VCS.

OPTIONS

Positional Arguments

Config file(s), separated by colon. Using .config.yaml in KAS_WORK_DIR if none is specified.

Named Arguments

Skip build steps. To skip more than one step, use this argument multiple times.

Possible choices: setup_dir, setup_home, init_setup_repos, repo_setup_loop, finish_setup_repos, repos_checkout, repos_apply_patches, setup_environ, write_bbconfig

Always checkout the desired commit/branch/tag of each repository, discarding any local changes
Pull new upstream changes to the desired branch even if it is already checked out locally
Output format (default: yaml)

Possible choices: yaml, json

Line indent (# of spaces, default: 4)
Replace floating refs with exact SHAs
Add tracking information of root repo
Set env defaults to captured env value
Create lockfile with exact SHAs
Update lockfile in-place (requires --lock)

SEE ALSO

kas-project-config(1), kas-checkout(1), kas-build(1)

KAS

Part of the kas(1) suite.

AUTHOR

Daniel Wagner, Jan Kiszka, Claudius Heine

COPYRIGHT

Siemens AG, 2017-2024

September 20, 2024 4.5