core.repository_prep#
repository_prep#
For every key in the configuration which has a subkey named “repository”, then following is done:
git clone repository.remote # if ! exists(repository.path)
git checkout [repository.branch,repository.tag] # if repository.{branch,tag}
git pull –rebase # if repository.branch
git status
The intended usage of this script is to prepare a repositories in a recently provisioned system. Such as a done by ‘qemu.provision’.
Configuration#
Ensure that the “repository” has sensible values for:
remote: url of the repository to clone
branch: name of the branch to check out and rebase
tag: name of the tag to check out
run_local: Optionally, set ‘run_local’ to True, in case the repos should just be checked out locally, instead of on the remote.
Retargetable: True#
- cijoe.core.scripts.repository_prep.main(args, cijoe)#
Clone, checkout branch and pull
CLI arguments#
--depth DEPTHArgument for git: Create a shallow clone with a history truncated to the specified number or revisions. The minimum possible value is 1, otherwise ignored. (default: None)
--single_branch {true,false}Argument for git: Clone only the history leading to the tip of the specified revision. (default: False)
--recursive {true,false}Argument for git: Recurse into the registered submodules, and update any nested submodules within. (default: True)