dploy

package
v0.0.0-...-752da31 Latest Latest
Warning

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

Go to latest
Published: May 22, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package dploy is the DC/OS deployment tool for appops.

It supports operations to create, deploy and manage microservices-architecture apps based on a collection of Marathon app specs.

To set the log output level, use the environment variable DPLOY_LOGLEVEL.

For a full guide visit http://dploy.sh

Index

Examples

Constants

View Source
const (
	ENV_VAR_DPLOY_LOGLEVEL     string        = "DPLOY_LOGLEVEL"
	ENV_VAR_DPLOY_EXAMPLES     string        = "DPLOY_EXAMPLES"
	DEFAULT_DEPLOY_WAIT_TIME   time.Duration = 10
	APP_DESCRIPTOR_FILENAME    string        = "dploy.app"
	DEFAULT_MARATHON_URL       string        = "http://localhost:8080"
	DEFAULT_APP_NAME           string        = "CHANGEME"
	MARATHON_APP_SPEC_DIR      string        = "specs/"
	MARATHON_APP_SPEC_EXT      string        = ".json"
	MARATHON_LABEL             string        = "DPLOY"
	MARATHON_OBSERVER_TEMPLATE string        = "https://raw.githubusercontent.com/mhausenblas/dploy/master/observer/observer.json"
	MARATHON_OBSERVER_PAT_FILE string        = ".pat"
	RESOURCETYPE_PLATFORM      string        = "platform"
	RESOURCETYPE_APP           string        = "app"
	RESOURCETYPE_GROUP         string        = "group"
	CMD_TRUNCATE               int           = 17
	EXAMPLE_HELLO_WORLD        string        = "https://raw.githubusercontent.com/mhausenblas/dploy/master/examples/helloworld.json"
	EXAMPLE_BUZZ               string        = "https://raw.githubusercontent.com/mhausenblas/dploy/master/examples/buzz/buzz.json"
	EXAMPLE_WP                 string        = "https://raw.githubusercontent.com/mhausenblas/dploy/master/examples/stateful/wordpress.json"
	USER_MSG_SUCCESS           string        = "🙌"
	USER_MSG_PROBLEM           string        = "🙁"
	USER_MSG_INFO              string        = "🗣"
	SYSTEM_MSG_ONLINE          string        = "online \t💚"
	SYSTEM_MSG_OFFLINE         string        = "offline\t💔"
)

Variables

This section is empty.

Functions

func Destroy

func Destroy(workdir string, showAll bool) bool

Destroy tears down the app. It scans the `specs/` directory for Marathon app specs and deletes apps using the Marathon API.

func Download

func Download(theURL string, intoDir string) (string, error)

func DryRun

func DryRun(workdir string, showAll bool) bool

DryRun validates the app descriptor by checking if Marathon is reachable and also checks if the app spec directory is present, incl. at least one Marathon app spec.

func Init

func Init(workdir string, showAll bool) bool

Init creates an app descriptor (dploy.app) and the `specs/` directory in the workdir specified as well as copies in example app specs. For example:

dploy.Init("../.")
Example (Output)
Init("/tmp/")
Output:

/tmp/dploy.app with following content:
 marathon_url: http://localhost:8080
 app_name: CHANGEME

func ListResources

func ListResources(workdir string, showAll bool) bool

ListResources lists the resource definitions of the app.

func ListRuntimeProperties

func ListRuntimeProperties(workdir string, showAll bool) bool

ListRuntimeProperties lists runtime properties of the app.

func Run

func Run(workdir string, showAll bool) bool

Run launches the app as defined in the descriptor and the app specs. It scans the `specs/` directory for Marathon app specs and launches them using the Marathon API.

func Scale

func Scale(workdir string, showAll bool, pid string, instances int) bool

Scale sets the number of instances of a particular µS identified through pid.

func Upgrade

func Upgrade(workdir string) bool

Upgrade updates all µS using app specs via Marathon. It is not used by the CLI but rather via the observer service to upgrade on push to a GitHub repo (/dploy handler)

Types

type DployApp

type DployApp struct {
	MarathonURL   string `yaml:"marathon_url"`
	AppName       string `yaml:"app_name"`
	RepoURL       string `yaml:"repo_url,omitempty"`
	PublicNode    string `yaml:"public_node,omitempty"`
	TriggerBranch string `yaml:"trigger_branch,omitempty"`
}

DployApp is the dploy application deployment descriptor, in short: app descriptor. It defines the connection to the target DC/OS cluster as well as the app properties.

Jump to

Keyboard shortcuts

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