deploy

package
v0.71.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

README

Deployment service

Deployment service checks if specified app has been installed with requested version, if not is uses meta descriptor to install missing app

Usage

Maven

endly maven.yaml

@maven.yaml

init:
  target:
    URL: ssh://127.0.0.1
    Credentials: localhost

pipeline:
  task1:
    action: deployment:deploy
    target: $target
    baseLocation: /tmp/
    appName: maven
    version: 3.5

Maven uses the following deployment descriptor

Tomcat

endly tomcat.yaml @tomcat.yaml

init:
  target:
    URL: ssh://127.0.0.1
    Credentials: localhost

pipeline:
  deployTomcat:
    action: deployment:deploy
    target: $target
    baseLocation: /use/local/
    appName: tomcat
    version: 7.0  
Gecko driver

endly geckodriver.yaml @geckodriver.yaml

init:
  target:
    URL: ssh://127.0.0.1
    Credentials: localhost

pipeline:
  task1:
    action: deployment:deploy
    target: $target
    appName: geckodriver
Selenium

endly selenium.yaml @selenium.yaml

init:
  target:
    URL: ssh://127.0.0.1
    Credentials: localhost

pipeline:
  task1:
    action: deployment:deploy
    target: $target
    appName: selenium-server-standalone
    version: 3.4
Go SDK

endly gosdk.yaml @gosdk.yaml

init:
  target:
    URL: ssh://127.0.0.1
    Credentials: localhost

pipeline:
  task1:
    action: deployment:deploy
    target: $target
    baseLocation: /usr/local
    appName: go
    version: 1.12

Node SDK

endly nodesdk.yaml @nodesdk.yaml

init:
  target:
    URL: ssh://127.0.0.1
    Credentials: localhost

pipeline:
  task1:
    action: deployment:deploy
    target: $target
    baseLocation: /usr/local
    appName: node
    version: 12.6

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
	AutoSudo  bool
	Commands  []string     `description:"os command"`
	Transfers []*copy.Rule `description:"asset transfer"`
}

Addition represents deployment additions.

func (*Addition) AsRunRequest

func (a *Addition) AsRunRequest(target *location.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     *copy.Rule           `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 *location.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"`
	BaseLocation string        `description:"default base location"`
}

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       *location.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.
	BaseLocation string             `description:" variable source: $deploy.baseLocation"`
}

ServiceRequest represent a deploy request

func (*Request) Expand

func (r *Request) Expand(context *endly.Context) *Request

func (*Request) Init

func (r *Request) Init() error

Validate check if request is valid otherwise returns error.

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