deploy

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

README

Deployment service Deployment service checks if target path resource, the app has been installed with requested version, if not it will transfer it and run all defined commands/transfers. Maven, tomcat use this service.

Service Id Action Description Request Response
deployment deploy run deployment DeployRequest DeployResponse

Documentation

Index

Constants

View Source
const ServiceID = "deployment"

ServiceID represents a deployment service id.

Variables

This section is empty.

Functions

func MatchVersion

func MatchVersion(expected, actual string) bool

MatchVersion checks expected and actual version returns true if matches.

func New

func New() endly.Service

New creates a new deployment service

Types

type Addition

type Addition struct {
	SuperUser bool
	Commands  []string            `description:"os command"`
	Transfers []*storage.Transfer `description:"asset transfer"`
}

Addition represents deployment additions.

func (*Addition) AsRunRequest

func (a *Addition) AsRunRequest(target *url.Resource) *exec.RunRequest

AsRunRequest creates a exec run request.

type Dependency

type Dependency struct {
	Name    string
	Version string
}

Dependency represents deployment dependency

type Deployment

type Deployment struct {
	Pre          *Addition            `description:"initialization deployment instruction"`
	Transfer     *storage.Transfer    `required:"true" description:"software deployment instruction"` //actual copy instruction
	Run          *exec.ExtractRequest `description:"post deployment commands, i.e. tar xvzf"`         //post deployment command like tar xvzf
	VersionCheck *exec.ExtractRequest `description:"version extraction command"`                      //command to check version
	Post         *Addition            `description:"post deployment instruction"`
}

Deployment represents deployment instruction

func (*Deployment) Validate

func (d *Deployment) Validate() error

Validate checks if request if valid

type LoadMetaRequest

type LoadMetaRequest struct {
	Source *url.Resource `required:"true" description:"deployment meta location"`
}

LoadMetaRequest represents Meta register request.

type LoadMetaResponse

type LoadMetaResponse struct {
	Meta *Meta
}

LoadMetaResponse represents deployment response

type Meta

type Meta struct {
	Name       string        //app name
	Versioning string        `required:"true" description:"versioning template for dynamic discovery i.e. Major.Minor.Release"` //versioning system, i.e. Major.Minor.Release
	Targets    []*TargetMeta `required:"true" description:"deployment instruction for various version and operating systems"`
}

Meta represents description of deployment instructions for various operating system

func (*Meta) Match

func (m *Meta) Match(operatingSystem *model.OperatingSystem, requestedVersion string) *TargetMeta

Match provides build instruction for matching os and version

func (*Meta) Validate

func (m *Meta) Validate() error

Validate checks is meta is valid.

type Request

type Request struct {
	Target  *url.Resource `required:"true" description:"target host"`                                                                                   //target host
	MetaURL string        `description:"optional URL for meta deployment file, if left empty the meta URL is construct as meta/deployment/**AppName**"` //deployment URL for meta deployment instruction
	AppName string        `required:"true" description:"application name, as defined in meta deployment file"`                                          //app name
	Version string        `description:"min required version, it can be 1, or 1.2 or specific version 1.2.1"`                                           //requested version
	Force   bool          `description:"force deployment even if app has been already installed"`                                                       //flag force deployment, by default if requested version matches the one from command version check. deployment is skipped.
}

ServiceRequest represent a deploy request

func (*Request) Messages

func (r *Request) Messages() []*msg.Message

Items returns tag messages

func (*Request) Validate

func (r *Request) Validate() error

Validate check if request is valid otherwise returns error.

type Response

type Response struct {
	Version string
}

Response represents a deploy response.

type TargetMeta

type TargetMeta struct {
	Version           string            //version of the software
	MinReleaseVersion map[string]string `required:"true" description:"min release version, key is major.minor, value is release or update version"` //min release version, key is major.minor, value is release or update version
	OsTarget          *model.OsTarget   `description:"operating system match"`                                                                      //if specified matches current os
	Deployment        *Deployment       `required:"true" description:"actual deployment instructions"`                                              //actual deployment instruction
	Dependencies      []*Dependency     `description:"app dependencies like sdk"`                                                                   //app dependencies like sdk
}

TargetMeta represents specific instruction for given os deployment.

Jump to

Keyboard shortcuts

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