build: Wait OSv to start up before uploading

This changes Capstan to use the same method as run.py for uploading. The
build command will launch QEMU and wait for cpiod.so to print out:

  Waiting for connection from host...

before starting the CPIO upload.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
build: Progress bar for file uploading

Uploading files can take a while so add a progress bar for it.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Merge pull request #123 from penberg/wait-osv-for-upload

build: Wait OSv to start up before uploading
Merge pull request #124 from penberg/build-progress-bar

build: Progress bar for file uploading
Capstan v0.1.3

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Add support for pre-configured tap devices (qemu only)
Merge pull request #125 from davedoesdev/master

Add support for pre-configured tap devices (qemu only)
Support pre-configured tap devices in vbox
Merge pull request #126 from davedoesdev/master

Support pre-configured tap devices in vbox
build: Fix info message ordering

If the build command needs to download a base image, print out
"Downloading" before "Building". Otherwise Capstan appears to be stuck
after downloading if the build step takes a while.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Coding style cleanups

Various coding style cleanups to build and run commands.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Update examples

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Rename util.Config to capstan.Template

Use terminology from Packer and call the VM image build configuration
"template" to avoid confusion with various other configs.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Introduce and use Image struct

Add a new Image struct that groups image name and hypervisor. Use that
in the build and run code as a cleanup.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Remove source files from gitignore

There's now a directory called `capstan` that contains Go source files
so remove it from gitignore.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Move Capstanfile parsing to frontend

Change the Build() function signature to take a Template and move
`Capstanfile` parsing to frontend. This allows "capstan run" to build a
template on the fly to support running Jar files directly.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Fix broken build

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Fix formatting in capstan_test.go

Courtesy of gofmt.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
run: Java Jar file support

Adds support for running Java Jar files directly without having to
define a Capstanfile. Capstan will automatically pull
"cloudius/osv-openjdk" base image and build new image with the Jar file
in it.

To run a Jar file, simply type:

  [penberg@nero capstan-example-java]$ capstan run target/capstan-example-java-1.0-SNAPSHOT-jar-with-dependencies.jar

and you will see something like this:

  Building capstan-example-java-1.0-SNAPSHOT-jar-with-dependencies...
  Uploading files...
  [ ... ]
  Created instance: capstan-example-java-1.0-SNAPSHOT-jar-with-dependencies
  OSv v0.13
  eth0: 192.168.122.15
  hello, world!

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Revert "Fix "Usage" to work with debian system."

This reverts commit 66adcf12f9c87da1eeea87c53286b6c4528c015f.

Patch author writes:

  I agree with Nadav. My patch change the original meaning of document.  My way
  for debian results in start OSv without bridge network. So please drop this
  patch, Pekka.