Scroll to navigation

KAS-FOR-ALL-REPOS(1) kas KAS-FOR-ALL-REPOS(1)

NAME

kas-for-all-repos - kas for-all-repos plugin

This plugin implements the kas for-all-repos command.

When this command is executed, kas will checkout the repositories listed in the chosen config file and then execute a specified command in each repository. It can be used to query the repository status, automate actions such as archiving the layers used in a build or to execute any other required commands.

For example, to print the commit hashes used by each repository used in the file kas-project.yml (assuming they are all git repositories) you could run:

kas for-all-repos kas-project.yml 'git rev-parse HEAD'


The environment for executing the command in each repository is extended to include the following variables:

  • KAS_REPO_NAME: The name of the current repository determined by either the name property or by the key used for this repo in the config file.
  • KAS_REPO_PATH: The path of the local directory where this repository is checked out, relative to the directory where kas is executed.
  • KAS_REPO_URL: The URL from which this repository was cloned, or an empty string if no remote URL was given in the config file.
  • KAS_REPO_COMMIT: The commit ID which was checked out for this repository, or an empty string if no commit was given in the config file.
  • KAS_REPO_BRANCH: The branch which was checked out for this repository, or an empty string if no branch was given in the config file.
  • KAS_REPO_TAG: The tag which was checked out for this repository, or an empty string if no tag was given in the config file.
  • KAS_REPO_REFSPEC: The refspec which was checked out for this repository, or an empty string if no refspec was given in the config file. This variable is obsolete and will be removed when support for respec keys is removed as well. Migrate your repos to commit/branch and use the related variables instead.



usage: kas for-all-repos [-h] [--skip SKIP] [--force-checkout] [--update] [-E]

[config] command


POSITIONAL ARGUMENTS

Config file(s), separated by colon. Using .config.yaml in KAS_WORK_DIR if none is specified.
Command to be executed as a string.

NAMED ARGUMENTS

Skip build steps

Default: []

Always checkout the desired commit/branch/tag of each repository, discarding any local changes

Default: False

Pull new upstream changes to the desired branch even if it is already checked out locally

Default: False

Keep current user environment block

Default: False


KAS

Part of the kas(1) suite.

AUTHOR

Daniel Wagner, Jan Kiszka, Claudius Heine

COPYRIGHT

Siemens AG, 2017-2024

April 10, 2024 4.3.2