KAS-FOR-ALL-REPOS(1)

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

SYNOPSIS

            kas for-all-repos [-h] [--skip STEP] [--force-checkout] [--update] [-E] [-k]
                              [config] command

DESCRIPTION

Runs a specified command in all checked out repositories.

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 refspec keys is removed as well. Migrate your repos to commit/branch and use the related variables instead.

OPTIONS

Positional Arguments

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

    command
        Command to be executed as a string.

Named Arguments

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

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

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

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

    -E=False, --preserve-env=False
        Keep current user environment block

    -k, --keep-config-unchanged
        Skip steps that change the configuration

KAS

Part of the kas(1) suite.

Author
Daniel Wagner, Jan Kiszka, Claudius Heine

Copyright
Siemens and contributors, 2017-2025