xcat2 / xcat-inventory

An inventory tool for xcat cluster
8 stars 16 forks source link

prototype of git backend support #115

Closed immarvin closed 5 years ago

immarvin commented 6 years ago

based on https://github.com/xcat2/xcat-inventory/issues/90 newly added backend subcommands:

[root@c910f03c05k21 inventory]# xcat-inventory -h
usage: xcat-inventory [-h] [--debug] [-v] [-V] <subcommand> ...

xCAT inventory management tool

Positional arguments:
  <subcommand>
    checkout          checkout to a specified revision
    commit            create a revision and push to remote backend
    diff              show inventory diff between files or file vs xCAT DB
    envlist           Show implicit environment variables during 'xcat-
                      inventory import', which can be used in inventory files
                      with format '{{<environment variable name>}}'
    export            Export the inventory data from xcat database
    help              Display help about this program or one of its
                      subcommands.
    import            Import inventory file to xcat database
    init              Initialize the inventory backend
    pull              sync the current workspace with remote workspace
    push              push the current workspace to remoteworkspace
    rev-list          list the revisions of the current workspace if no
                      revision is specified, otherwise, show the info of the
                      specified revision
    workspace-checkout
                      checkout a workspace
    workspace-delete  remove a workspace
    workspace-list    list all the workspaces
    workspace-new     create a new workspace

Optional arguments:
  -h, --help          Prints help message
  --debug             Prints debugging output into the log file (not
                      implemented yet).
  -v, --verbose       Prints verbose output.
  -V, --version       Shows the program version and exits.

See "xcat-inventory help COMMAND" for help on a specific command.

on xcat-inventory checkout <rev>, a temp branch <rev>@<branch> will be created in backend git

on xcat-inventory commit <revision> -m <revision description>, a tag <revision>#<branch> will be generated in current branch in backend git, need to process the conversion of git tag and the in commit,checkout,rev-list

xuweibj commented 6 years ago

Verified steps:

  1. Configure "inventory.cfg"
  2. Create new repo xwbj/backend_test_1 on github
  3. Run xcat-inventory init, got error

Whether need to config user.name and user.email?

immarvin commented 5 years ago

UT Result by test cases: xcattest.log.20181229094600.txt