Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dominodatalab/vagrant-exec
:neckbeard: Golang wrapper around the Vagrant CLI
https://github.com/dominodatalab/vagrant-exec
golang vagrant
Last synced: 29 days ago
JSON representation
:neckbeard: Golang wrapper around the Vagrant CLI
- Host: GitHub
- URL: https://github.com/dominodatalab/vagrant-exec
- Owner: dominodatalab
- License: apache-2.0
- Created: 2019-06-26T17:23:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-07-18T14:15:21.000Z (over 5 years ago)
- Last Synced: 2024-11-14T13:44:15.581Z (about 1 month ago)
- Topics: golang, vagrant
- Language: Go
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vagrant-exec
[![Build Status](https://travis-ci.org/dominodatalab/vagrant-exec.svg?branch=master)](https://travis-ci.org/dominodatalab/vagrant-exec)
[![Go Report Card](https://goreportcard.com/badge/github.com/dominodatalab/vagrant-exec)](https://goreportcard.com/report/github.com/dominodatalab/vagrant-exec)
[![GoDoc](https://godoc.org/github.com/dominodatalab/vagrant-exec?status.svg)](https://godoc.org/github.com/dominodatalab/vagrant-exec)Golang wrapper around Vagrant CLI.
## Usage
```go
package mainimport (
"fmt"ve "github.com/dominodatalab/vagrant-exec"
)func main() {
// point to directory where the Vagrantfile is located and enable debug logging
vagrant := ve.New("/path/to/Vagrantfile/directory", true)// check the install version
version, err := vagrant.Version()
if err != nil {
panic(err)
}
fmt.Println(version)// create and provision VMs
if err := vagrant.Up(); err != nil {
panic(err)
}// query the status of all VMs
statusList, err := vagrant.Status()
if err != nil {
panic(err)
}
for _, status := range statusList {
fmt.Printf("%#v", status)
}// stop the VMs
if err := vagrant.Halt(); err != nil {
panic(err)
}// destroy the VMs
if err := vagrant.Destroy(); err != nil {
panic(err)
}// install a plugin
plugin := ve.Plugin{
Name: "vagrant-disksize",
Version: "0.1.3",
Location: "local",
}
if err := vagrant.PluginInstall(plugin); err != nil {
panic(err)
}// list all plugins
plugins, err := vagrant.PluginList()
if err != nil {
panic(err)
}
for _, plugin := range plugins {
fmt.Printf("%#v", plugin)
}
}
```## Contributions
Any suggestions and/or contributions are appreciated. Please submit an issue or PR with your suggested changes.