builder

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2015 License: Apache-2.0 Imports: 18 Imported by: 0

README

Deis Builder

Builder creates Docker images to be run elsewhere on the Deis platform. Builder itself also runs in a Docker container.

This Docker image is based on the official alpine:3.2 image.

Please add any issues you find with this software to the Deis Project.

Usage

Please consult the Makefile for current instructions on how to build, test, push, install, and start deis/builder.

Environment Variables

  • DEBUG enables verbose output if set
  • ETCD_PORT sets the TCP port on which to connect to the local etcd daemon (default: 4001)
  • ETCD_PATH sets the etcd directory where the builder announces its configuration (default: /deis/builder)
  • ETCD_TTL sets the time-to-live before etcd purges a configuration value, in seconds (default: 10)
  • PORT sets the TCP port on which the builder listens (default: 2222)

License

© 2015 Engine Yard, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

Overview

Package builder provides libraries for the Deis builder.

The Deis builder is responsible for packaging Docker images for consumers.

The builder/cli package contains command line clients for this library.

Index

Constants

View Source
const (
	StatusOk = iota
	StatusLocalError
)

Return codes that will be sent to the shell.

Variables

This section is empty.

Functions

func GetDefaultType

func GetDefaultType(bytes []byte) (string, error)

GetDefaultType returns the default process types given a YAML byte array.

func KillOnExit added in v1.10.0

func KillOnExit(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)

KillOnExit kills PIDs when the program exits.

Otherwise, this blocks until an os.Interrupt or os.Kill is received.

Params:

This treats Params as a map of process names (unimportant) to PIDs. It then

attempts to kill all of the pids that it receives.

func ParseControllerConfig

func ParseControllerConfig(bytes []byte) ([]string, error)

ParseControllerConfig returns configuration key/value pair strings from a config.

func ParseDomain

func ParseDomain(bytes []byte) (string, error)

ParseDomain returns the domain field from the bytes of a build hook response.

func ParseReleaseVersion

func ParseReleaseVersion(bytes []byte) (int, error)

ParseReleaseVersion returns the version field from the bytes of a build hook response.

func Run added in v1.10.0

func Run(cmd string) int

Run starts the Builder service.

The Builder service is responsible for setting up the local container environment and then listening for new builds. The main listening service is SSH. Builder listens for new Git commands and then sends those on to Git.

Run returns on of the Status* status code constants.

func Sleep added in v1.10.0

func Sleep(c cookoo.Context, p *cookoo.Params) (interface{}, cookoo.Interrupt)

Sleep delays the execution of the remainder of the chain of commands.

Params:

	-duration (time.Duration): Time to sleep.
 -message (string): The message to log when entering sleep.

func YamlToJSON added in v1.4.0

func YamlToJSON(bytes []byte) (string, error)

YamlToJSON takes an input yaml string, parses it and returns a string formatted as json.

Types

type BuildHook

type BuildHook struct {
	Sha         string      `json:"sha"`
	ReceiveUser string      `json:"receive_user"`
	ReceiveRepo string      `json:"receive_repo"`
	Image       string      `json:"image"`
	Procfile    ProcessType `json:"procfile"`
	Dockerfile  string      `json:"dockerfile"`
}

BuildHook represents a controller's build-hook object.

type BuildHookResponse

type BuildHookResponse struct {
	Release map[string]int `json:"release"`
	Domains []string       `json:"domains"`
}

BuildHookResponse represents a controller's build-hook response object.

type Config

type Config struct {
	Owner   string                 `json:"owner"`
	App     string                 `json:"app"`
	Values  map[string]interface{} `json:"values"`
	Memory  map[string]string      `json:"memory"`
	CPU     map[string]int         `json:"cpu"`
	Tags    map[string]string      `json:"tags"`
	UUID    string                 `json:"uuid"`
	Created time.Time              `json:"created"`
	Updated time.Time              `json:"updated"`
}

Config represents a Deis application's configuration.

func ParseConfig

func ParseConfig(body []byte) (*Config, error)

ParseConfig takes a response body from the controller and returns a Config object.

type ConfigHook

type ConfigHook struct {
	ReceiveUser string `json:"receive_user"`
	ReceiveRepo string `json:"receive_repo"`
}

ConfigHook represents a repository from which to extract the configuration and user to use.

type ProcessType

type ProcessType map[string]string

ProcessType represents the key/value mappings of a process type to a process inside a Heroku Procfile.

See https://devcenter.heroku.com/articles/procfile

Directories

Path Synopsis
Package confd provides basic Confd support.
Package confd provides basic Confd support.
Package docker provides Docker utlities.
Package docker provides Docker utlities.
Package etcd is a library for performing common Etcd tasks.
Package etcd is a library for performing common Etcd tasks.
Package sshd implements an SSH server.
Package sshd implements an SSH server.

Jump to

Keyboard shortcuts

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