bundle

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const TerraformTemplateName = "terraform-module"

Variables

This section is empty.

Functions

func ApplyTransformations

func ApplyTransformations(schema map[string]interface{}, transformations []func(map[string]interface{}) error) error

func Generate added in v0.0.8

func Generate(data *template.Data) error

func GenerateSchema

func GenerateSchema(schema map[string]interface{}, metadata map[string]string, buffer io.Writer) error

generateSchema generates a specific schema-*.json file

func GetConnections added in v0.3.0

func GetConnections(t *template.Data) error

TODO fetch these from the API instead of hardcoding

func Package added in v0.3.0

func Package(b *Bundle, filePath string, buf io.Writer) error

func Publish added in v0.3.0

func Publish(c *client.MassdriverClient, b *Bundle) error

func RunPrompt added in v0.0.8

func RunPrompt(t *template.Data) error

func UploadToPresignedS3URL

func UploadToPresignedS3URL(url string, object io.Reader) error

Types

type AppBlock added in v0.4.9

type AppBlock struct {
	Envs     map[string]string `json:"envs" yaml:"envs"`
	Policies []string          `json:"policies" yaml:"policies"`
	Secrets  map[string]Secret `json:"secrets" yaml:"secrets"`
}

type Bundle

type Bundle struct {
	Schema      string                 `json:"schema" yaml:"schema"`
	Name        string                 `json:"name" yaml:"name"`
	Description string                 `json:"description" yaml:"description"`
	SourceURL   string                 `json:"source_url" yaml:"source_url"`
	Type        string                 `json:"type" yaml:"type"`
	Access      string                 `json:"access" yaml:"access"`
	Steps       []Step                 `json:"steps" yaml:"steps"`
	Artifacts   map[string]interface{} `json:"artifacts" yaml:"artifacts"`
	Params      map[string]interface{} `json:"params" yaml:"params"`
	Connections map[string]interface{} `json:"connections" yaml:"connections"`
	UI          map[string]interface{} `json:"ui" yaml:"ui"`
	App         *AppBlock              `json:"app" yaml:"app"`
}

func Parse

func Parse(path string, overrides map[string]interface{}) (*Bundle, error)

ParseBundle parses a bundle from a YAML file overrides allow the CLI to override specific bundle metadata. This is useful in a CI/CD scenario when you want to change the `access` if you are deploying to a sandbox org.

func (*Bundle) Build added in v0.3.0

func (b *Bundle) Build(c *client.MassdriverClient, output string) error

func (*Bundle) GenerateSchemas

func (b *Bundle) GenerateSchemas(dir string) error

Build generates all bundle files in the given bundle

func (*Bundle) Hydrate

func (b *Bundle) Hydrate(path string, c *client.MassdriverClient) error

func (*Bundle) IsApplication added in v0.4.9

func (b *Bundle) IsApplication() bool

func (*Bundle) IsInfrastructure added in v0.4.9

func (b *Bundle) IsInfrastructure() bool

func (*Bundle) Metadata

func (b *Bundle) Metadata(schemaType string) map[string]string

Metadata returns common metadata fields for each JSON Schema

func (*Bundle) PublishToMassdriver added in v0.3.0

func (b *Bundle) PublishToMassdriver(srcDir string, c *client.MassdriverClient) (string, error)

type Overrides added in v0.1.0

type Overrides struct {
	Access string
}

type PublishPost added in v0.1.0

type PublishPost struct {
	Name              string                 `json:"name"`
	Description       string                 `json:"description"`
	Type              string                 `json:"type"`
	SourceURL         string                 `json:"source_url"`
	Access            string                 `json:"access"`
	ArtifactsSchema   map[string]interface{} `json:"artifacts_schema"`
	ConnectionsSchema map[string]interface{} `json:"connections_schema"`
	ParamsSchema      map[string]interface{} `json:"params_schema"`
	UISchema          map[string]interface{} `json:"ui_schema"`
	OperatorGuide     []byte                 `json:"operator_guide,omitempty"`
	AppSpec           *AppBlock              `json:"app,omitempty"`
}

type PublishResponse added in v0.1.0

type PublishResponse struct {
	UploadLocation string `json:"upload_location"`
}

type S3PresignEndpointResponse

type S3PresignEndpointResponse struct {
	Error                 xml.Name `xml:"Error"`
	Code                  string   `xml:"Code"`
	Message               string   `xml:"Message"`
	AWSAccessKeyID        string   `xml:"AWSAccessKeyId"`
	StringToSign          string   `xml:"StringToSign"`
	SignatureProvided     string   `xml:"SignatureProvided"`
	StringToSignBytes     []byte   `xml:"StringToSignBytes"`
	CanonicalRequest      string   `xml:"CanonicalRequest"`
	CanonicalRequestBytes []byte   `xml:"CanonicalRequestBytes"`
	RequestID             string   `xml:"RequestId"`
	HostID                string   `xml:"HostId"`
}

type Secret added in v0.5.0

type Secret struct {
	Required    bool   `json:"required" yaml:"required"`
	Json        bool   `json:"json" yaml:"json"`
	Title       string `json:"title" yaml:"title"`
	Description string `json:"description" yaml:"description"`
}

type Step added in v0.1.0

type Step struct {
	Path        string `json:"path" yaml:"path"`
	Provisioner string `json:"provisioner" yaml:"provisioner"`
}

Jump to

Keyboard shortcuts

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