-
Notifications
You must be signed in to change notification settings - Fork 19
Repoclient cookbook
repoclient create <reponame>
repoclient generatemetadata <reponame>
repoclient uploadto <reponame> <rpm1> ... <rpmN>
repoclient deleterpm <reponame> <rpm1> ... <rpmN>
propagate <from_repo> <arch>/<name> <to_repo>
(If you do not specify a full RPM name when propagating, the most recent matching RPM will be propagated instead.)
repoclient deletevirtual <virtual_reponame>
repoclient deletestatic <reponame>
repoclient redirectto <virtual_reponame> <redirect_url>
After this if a machine queries <virtual_reponame>, it will use the repo at <redirect_url> instead.
linktostatic <virtual_reponame> <static_reponame> #Creates or updates a virtual repository that points to a static repository
linktovirtual <virtual_reponame> <virtual_reponame> #Creates or updates a virtual repository that points to another virtual repository
You can mark regular (not virtual, that wouldn't make any sense) repositories with so-called 'tags'. The tags are used for queries and can be seen/modified on the repository web page.
repoclient tag repo1 'hello_world'
repoclient tag repo1 'yum-was-here'
repoclient taglist repo1
results in :
hello_world
yum-was-here
repoclient untag repo1 'hello_world'
repoclient querystatic [-name <regex>] [-tag <tag1,tagN>] [-notag <tag1,tagN>] [-newer <days>] [-older <days>]
repoclient queryvirtual [-name <regex>] [-newer <days>] [-older <days>] [-showDestination true]
tag combinations are OR :
repoclient querystatic -tag 'foo,bar,baz' means
"repositories with (foo OR bar OR baz) as tags"
however, BEWARE:
notag combinations are OR too but that means AND! Consider the following :
repoclient querystatic -notag 'foo,bar,baz'
This means
"repositories with NOT(foo OR bar OR baz) as tags"
which evaluates (De Morgan's laws) to
"repositories with NOT(foo as tag) AND NOT(bar as tag) AND NOT(baz as tag)"
You can leverage the power of bash to do pretty cool things, like piping the output of querystatic into xargs or use a for loop!
Putting it together
repoclient querystatic -tag 'this_repo_is_trash,delete_me' -older 7 -name 'myapprepo_*' | xargs repoclient deletestatic
or
for REPO in `repoclient querystatic -tag 'live_deployed'`; do repoclient tag $REPO 'important'; done