Skip to content

hyperblock/hblock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

hblock

hyper block command line tools and SDK library.

Main page: http://www.hyperblock.org

Currently support VM format 'qcow2', and 'lvm' will be supported in the near future

Installation

  1. Install command 'qcow2-img' and create a soft link.
    compile srouce code from https://github.com/hyperblock/qemu/tree/hyper-block, use 'make qcow2-img' to build.

  2. Build hblock from the source.

    • pre-install need

      • go-flags github.com/jessevdk/go-flags
      • yaml gopkg.in/yaml.v2
      • go.uuid github.com/satori/go.uuid
      • libguestfs libguestfs.org/guestfs
    • use 'go build hb.go' and create a soft link.

  3. Need a WebDAV server if use some remote options.

How to use

hb <command> [options]

Note. use 'hb <command> -h' to see detail.

======== support commands =======

init            create empty backingfile
config          get and set global options
clone           clone a repository from remote or local path
remote          manage set of tracked repositories
rebase          reapply volume's backingfile and parent-layer 
branch          list,create or delete branches
checkout        switch branches or restore volume
commit          record volume's changes
reset           reset current HEAD to the specified state
pull            fetch from and integrate with another repository of a local branch
push            update remote repository
list            list backingfiles in current workspace
show            show backingfile's detail
log             show commit logs
  • init

Usage:
  hb init <template name> [OPTIONS]

Application Options:  
  --size=   [required] Disk size(M/G) of template.
			eg.
			hblock init template0 --size=500M -f qcow2.

-o=           [optional] output volume name.    
-f, --format= 'qcow2' of 'lvm'.
  • config

Usage:
  hb config [OPTIONS]  

Application Options:
	  --global= [user.name|user.email] set global configuration.
	  --get=    <name>    Get value : <name>
  • clone

Usage:
  hb clone <repo path> [OPTIONS]

Application Options:
  -l, --layer=       Checkout <layer> instead of the HEAD    
	  --hardlink   use local hardlinks.    
  -b, --branch=      Clone the specified <branch> instead of default ('master').    
  -n, --no-checkout  No checkout of HEAD is performed after clone is complete.
  • remote

Usage:
  hb remote [OPTIONS]

Application Options:
  -a, --verbose  show remotes verbose
  -v, --volume=  set <volume> whose repo remotes need to be edited.
      --add      <name> <url>	Add a new remote-host to local remote-host list.
  -d, --remove=  <name>	Delete a host from local remote-host list.
      --rename   <old_name> <new_name>	 Rename an exsiting host name.
      --set-url
  • rebase

Usage:
  hb rebase <volume_name> [OPTIONS]

Application Options:
  -b, --backingfile= <backingfile>
  -l, --layer=       <layer>
  • branch

Usage:
  hb branch [OPTIONS]

Application Options:
	  --list         list branch names.    
  -a, --all          list both remote-tracking and local branches.    
  -m, --move=        <exist_branch> <new_branch> move/rename a branch.    
  -t, --backingfile= required if use '-m'    
  -v, --volume=    
  • checkout

Usage:
  hb checkout [OPTIONS]

Application Options:
  -v, --vol=         <volume_name> <layer | branch> Specify the volume name which needs to be
                     update(restore).
  -t, --backingfile= <backingfile> <layer | branch> Create a new volume from <backingfile>.
  -o, --output=      <output_volume_path>.
  -b, --base=        <branch> Create a new branch of base on the specify volume.
  -f, --force.

  • commit

Usage:
  hb commit <volume name> [OPTIONS]

Application Options:
  -m=         commit message
	  --uuid= set uuid by manual instead of auto-generate.
  • reset

Usage:
	hb reset <volume> [<commit_uuid>] | [HEAD point]	reset <volume> and discard changes.
	eg.
		hb reset volume0 3f2ed7		reset 'volume' to specified commit 3f2ed7
		hb reset volume0 HEAD^^		reset 'volume' to the last 2 commits
		hb reset volume0 HEAD~5		reset 'volume' to the last 5 commits    	
  • pull

Usage:
  hb pull <remote> <branch> [OPTIONS]

Application Options:
  -v, --volume=
  • push

Usage:
  hb push <repository> <refspec> [OPTIONS]

Application Options:
  -v, --volume= <volume>
  • log

Usage:
  hb log <volume name> [OPTIONS]
  • list

Usage:
	hb list
	hb list <dir_path>
  • show

Usage:
	hb show <backing file> 	show backing file details.

About

hyper block command line tools and SDK library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages