vagrantcloud

package
v1.1.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2026 License: MPL-2.0 Imports: 25 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

vagrant_cloud implements the packersdk.PostProcessor interface and adds a post-processor that uploads artifacts from the vagrant post-processor and vagrant builder to Vagrant Cloud (vagrantcloud.com) or manages self hosted boxes on the Vagrant Cloud

Index

Constants

View Source
const BuilderId = "pearkes.post-processor.vagrant-cloud"
View Source
const VAGRANT_CLOUD_DIRECT_UPLOAD_LIMIT = 5368709120 // Upload limit is 5G
View Source
const VAGRANT_CLOUD_URL = "https://vagrantcloud.com/api/v2"

Variables

This section is empty.

Functions

This section is empty.

Types

type Artifact

type Artifact struct {
	Tag      string
	Provider string
}

func NewArtifact

func NewArtifact(provider, tag string) *Artifact

func (*Artifact) BuilderId

func (*Artifact) BuilderId() string

func (*Artifact) Destroy

func (a *Artifact) Destroy() error

func (*Artifact) Files

func (a *Artifact) Files() []string

func (*Artifact) Id

func (a *Artifact) Id() string

func (*Artifact) State

func (*Artifact) State(name string) interface{}

func (*Artifact) String

func (a *Artifact) String() string

type Box

type Box struct {
	Tag      string     `json:"tag"`
	Versions []*Version `json:"versions"`
}

func (*Box) HasVersion

func (b *Box) HasVersion(version string) (bool, *Version)

type Config

type Config struct {
	common.PackerConfig `mapstructure:",squash"`

	Tag                 string `mapstructure:"box_tag"`
	Version             string `mapstructure:"version"`
	VersionDescription  string `mapstructure:"version_description"`
	NoRelease           bool   `mapstructure:"no_release"`
	Architecture        string `mapstructure:"architecture"`
	DefaultArchitecture string `mapstructure:"default_architecture"`

	AccessToken           string `mapstructure:"access_token"`
	VagrantCloudUrl       string `mapstructure:"vagrant_cloud_url"`
	InsecureSkipTLSVerify bool   `mapstructure:"insecure_skip_tls_verify"`
	BoxDownloadUrl        string `mapstructure:"box_download_url"`
	NoDirectUpload        bool   `mapstructure:"no_direct_upload"`
	BoxChecksum           string `mapstructure:"box_checksum"`
	// contains filtered or unexported fields
}

func (*Config) FlatMapstructure

func (*Config) FlatMapstructure() interface{ HCL2Spec() map[string]hcldec.Spec }

FlatMapstructure returns a new FlatConfig. FlatConfig is an auto-generated flat version of Config. Where the contents a fields with a `mapstructure:,squash` tag are bubbled up.

type FlatConfig

type FlatConfig struct {
	PackerBuildName       *string           `mapstructure:"packer_build_name" cty:"packer_build_name" hcl:"packer_build_name"`
	PackerBuilderType     *string           `mapstructure:"packer_builder_type" cty:"packer_builder_type" hcl:"packer_builder_type"`
	PackerCoreVersion     *string           `mapstructure:"packer_core_version" cty:"packer_core_version" hcl:"packer_core_version"`
	PackerDebug           *bool             `mapstructure:"packer_debug" cty:"packer_debug" hcl:"packer_debug"`
	PackerForce           *bool             `mapstructure:"packer_force" cty:"packer_force" hcl:"packer_force"`
	PackerOnError         *string           `mapstructure:"packer_on_error" cty:"packer_on_error" hcl:"packer_on_error"`
	PackerUserVars        map[string]string `mapstructure:"packer_user_variables" cty:"packer_user_variables" hcl:"packer_user_variables"`
	PackerSensitiveVars   []string          `mapstructure:"packer_sensitive_variables" cty:"packer_sensitive_variables" hcl:"packer_sensitive_variables"`
	Tag                   *string           `mapstructure:"box_tag" cty:"box_tag" hcl:"box_tag"`
	Version               *string           `mapstructure:"version" cty:"version" hcl:"version"`
	VersionDescription    *string           `mapstructure:"version_description" cty:"version_description" hcl:"version_description"`
	NoRelease             *bool             `mapstructure:"no_release" cty:"no_release" hcl:"no_release"`
	Architecture          *string           `mapstructure:"architecture" cty:"architecture" hcl:"architecture"`
	DefaultArchitecture   *string           `mapstructure:"default_architecture" cty:"default_architecture" hcl:"default_architecture"`
	AccessToken           *string           `mapstructure:"access_token" cty:"access_token" hcl:"access_token"`
	VagrantCloudUrl       *string           `mapstructure:"vagrant_cloud_url" cty:"vagrant_cloud_url" hcl:"vagrant_cloud_url"`
	InsecureSkipTLSVerify *bool             `mapstructure:"insecure_skip_tls_verify" cty:"insecure_skip_tls_verify" hcl:"insecure_skip_tls_verify"`
	BoxDownloadUrl        *string           `mapstructure:"box_download_url" cty:"box_download_url" hcl:"box_download_url"`
	NoDirectUpload        *bool             `mapstructure:"no_direct_upload" cty:"no_direct_upload" hcl:"no_direct_upload"`
	BoxChecksum           *string           `mapstructure:"box_checksum" cty:"box_checksum" hcl:"box_checksum"`
}

FlatConfig is an auto-generated flat version of Config. Where the contents of a field with a `mapstructure:,squash` tag are bubbled up.

func (*FlatConfig) HCL2Spec

func (*FlatConfig) HCL2Spec() map[string]hcldec.Spec

HCL2Spec returns the hcl spec of a Config. This spec is used by HCL to read the fields of Config. The decoded values from this spec will then be applied to a FlatConfig.

type PostProcessor

type PostProcessor struct {
	// contains filtered or unexported fields
}

func (*PostProcessor) ConfigSpec

func (p *PostProcessor) ConfigSpec() hcldec.ObjectSpec

func (*PostProcessor) Configure

func (p *PostProcessor) Configure(raws ...interface{}) error

func (*PostProcessor) PostProcess

func (p *PostProcessor) PostProcess(ctx context.Context, ui packersdk.Ui, artifact packersdk.Artifact) (packersdk.Artifact, bool, bool, error)

type Provider

type Provider struct {
	Name                string `json:"name"`
	Url                 string `json:"url,omitempty"`
	HostedToken         string `json:"hosted_token,omitempty"`
	UploadUrl           string `json:"upload_url,omitempty"`
	Checksum            string `json:"checksum,omitempty"`
	ChecksumType        string `json:"checksum_type,omitempty"`
	Architecture        string `json:"architecture,omitempty"`
	DefaultArchitecture bool   `json:"default_architecture,omitempty"`
}

type Upload

type Upload struct {
	UploadPath   string `json:"upload_path"`
	CallbackPath string `json:"callback"`
}

type VagrantCloudClient

type VagrantCloudClient struct {

	// The base URL of the API
	BaseURL string

	// Access token
	AccessToken string
	// contains filtered or unexported fields
}

func (*VagrantCloudClient) Callback

func (v *VagrantCloudClient) Callback(url string) (*http.Response, error)

func (*VagrantCloudClient) Delete

func (v *VagrantCloudClient) Delete(path string) (*http.Response, error)

func (*VagrantCloudClient) DirectUpload

func (v *VagrantCloudClient) DirectUpload(path string, url string) (*http.Response, error)

func (*VagrantCloudClient) Get

func (v *VagrantCloudClient) Get(path string) (*http.Response, error)

func (VagrantCloudClient) New

func (v VagrantCloudClient) New(baseUrl string, token string, InsecureSkipTLSVerify bool) (*VagrantCloudClient, error)

func (*VagrantCloudClient) Post

func (v *VagrantCloudClient) Post(path string, body interface{}) (*http.Response, error)

func (*VagrantCloudClient) Put

func (v *VagrantCloudClient) Put(path string) (*http.Response, error)

func (*VagrantCloudClient) Upload

func (v *VagrantCloudClient) Upload(path string, url string) (*http.Response, error)

func (*VagrantCloudClient) ValidateAuthentication

func (v *VagrantCloudClient) ValidateAuthentication() error

type VagrantCloudErrors

type VagrantCloudErrors struct {
	Errors []interface{} `json:"errors"`
}

func (VagrantCloudErrors) FormatErrors

func (v VagrantCloudErrors) FormatErrors() string

type Version

type Version struct {
	Version     string `json:"version"`
	Description string `json:"description,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL