App-FuguVM

 view release on metacpan or  search on metacpan

man/fuguvm/fuguvm.1  view on Meta::CPAN

.Bd -literal -offset indent
$ fuguvm ssh -- sh -c \e
	"echo 'SITE_BACKUP = http://ftp.openbsd.org/pub/OpenBSD/distfiles/' \e
	>> /etc/mk.conf"
$ proxy="$(fuguvm status proxy_url)"
$ fuguvm ssh -- sh -c \e
	"cd /usr/ports/devel/gmake && env http_proxy=$proxy make fetch"
.Ed
.Pp
The host verified the ports tree, and
.Ql make checksum
verifies each distfile against its
.Pa distinfo
digest in the guest.
.Sh FILES
.Bl -tag -width ".fuguvm/vms/<name>.conf" -compact
.It Pa ~/.fuguvmrc
The global configuration.
.It Pa .fuguvmrc
The project configuration, at the project root.
.It Pa .fuguvm/vms/<name>.conf
A guest declaration outside the two configuration files.
.It Pa .fuguvm/state/<name>/
The state of one guest: the working disk, the JSON state, the PID
files, and the logs.
.It Pa ~/.cache/fuguvm/
The default cache directory.
.It Pa share/fuguvm/expect/
The shipped
.Xr expect 1
scripts.
.It Pa share/fuguvm/cache-generation
The generation counter of the image cache.
.It Pa share/fuguvm/signify/
The signify public key of the default release.
.El
.Sh EXIT STATUS
.Nm
exits with one of the following values:
.Pp
.Bl -tag -width Ds -offset indent -compact
.It 0
Success.
.It 1
General error.
A stopped guest on a connection command, a failed transfer, a failed
download or verification, an exhausted port range, and an
.Cm image export
target that exists also give this status.
.It 2
Invalid arguments.
.It 3
Configuration error: no project, a line that does not parse, an
invalid value, a missing or contradicting install directive, an
absent QEMU binary, or a QEMU version that does not match the pin.
.It 4
Guest not found.
.It 5
The guest runs.
.It 7
Timeout in
.Cm wait .
.It 9
An
.Xr expect 1
script failed, the install scripts included.
.It 11
Snapshot not found.
.El
.Pp
.Cm ssh
with a
.Ar command
exits with the status of the remote command.
A remote status can read like a tool status, and the diagnostic on
standard error tells the two apart.
.Sh EXAMPLES
Initialize a project, boot the default guest, and run a command in it:
.Bd -literal -offset indent
$ fuguvm init
$ fuguvm up
$ fuguvm ssh -- uname -a
OpenBSD openbsd-test.my.domain 7.8 GENERIC arm64
.Ed
.Pp
Copy a source tree in, build it, and copy the report back:
.Bd -literal -offset indent
$ fuguvm put src /root/src
$ fuguvm ssh -- sh -c 'cd /root/src && make regress > report.txt'
$ fuguvm get /root/src/report.txt report.txt
.Ed
.Pp
Declare an amd64 guest and a fleet of two guests with automatic ports
in
.Pa .fuguvmrc :
.Bd -literal -offset indent
vm "openbsd-amd64" {
	arch      amd64
	disk_size 16G
}
vm "scenario-1" {
	ssh_port     auto
	console_port auto
}
vm "scenario-2" {
	ssh_port     auto
	console_port auto
}

$ fuguvm --vm openbsd-amd64 up
$ fuguvm --vm scenario-1 up
$ fuguvm --vm scenario-1 status ssh_port
2222
.Ed
.Pp
Cache a provisioned state, and restore it on the next checkout:
.Bd -literal -offset indent
$ fuguvm ssh -- pkg_add gmake
$ fuguvm down
$ fuguvm snapshot save deps
$ fuguvm snapshot restore deps && fuguvm up



( run in 1.603 second using v1.01-cache-2.11-cpan-85d3896f969 )