Documentation ¶
Index ¶
- Constants
- Variables
- func Run(conf *Config, env sys.Env, storageDriver storagedriver.StorageDriver) error
- type Config
- func (c Config) App() string
- func (c Config) BuilderPodTickDuration() time.Duration
- func (c Config) BuilderPodWaitDuration() time.Duration
- func (c *Config) CheckDurations()
- func (c Config) ObjectStorageTickDuration() time.Duration
- func (c Config) ObjectStorageWaitDuration() time.Duration
- func (c Config) SessionIdleInterval() time.Duration
Constants ¶
const ( // TarKeyPattern is the template for storing tar key files. TarKeyPattern = "%s/tar" // GitKeyPattern is the template for storing git key files. GitKeyPattern = "home/%s:git-%s" )
Variables ¶
var Stacks []map[string]string
Stacks for drycc
Functions ¶
func Run ¶
func Run(conf *Config, env sys.Env, storageDriver storagedriver.StorageDriver) error
Run runs the git-receive hook. This func is effectively the main for the git-receive hook, although it is called from the main in boot.go.
Types ¶
type Config ¶
type Config struct { // k8s service discovery env vars ControllerHost string `envconfig:"DRYCC_CONTROLLER_API_SERVICE_HOST" required:"true"` ControllerPort string `envconfig:"DRYCC_CONTROLLER_API_SERVICE_PORT" required:"true"` GitHome string `envconfig:"GIT_HOME" required:"true"` SSHConnection string `envconfig:"SSH_CONNECTION" required:"true"` SSHOriginalCommand string `envconfig:"SSH_ORIGINAL_COMMAND" required:"true"` Repository string `envconfig:"REPOSITORY" required:"true"` Username string `envconfig:"USERNAME" required:"true"` Fingerprint string `envconfig:"FINGERPRINT" required:"true"` PodNamespace string `envconfig:"POD_NAMESPACE" required:"true"` StorageRegion string `envconfig:"STORAGE_REGION" default:"us-east-1"` Debug bool `envconfig:"DRYCC_DEBUG" default:"false"` BuilderPodTickDurationMSec int `envconfig:"BUILDER_POD_TICK_DURATION" default:"100"` BuilderPodWaitDurationMSec int `envconfig:"BUILDER_POD_WAIT_DURATION" default:"900000"` // 15 minutes ObjectStorageTickDurationMSec int `envconfig:"OBJECT_STORAGE_TICK_DURATION" default:"500"` ObjectStorageWaitDurationMSec int `envconfig:"OBJECT_STORAGE_WAIT_DURATION" default:"300000"` // 5 minutes SessionIdleIntervalMsec int `envconfig:"SESSION_IDLE_INTERVAL" default:"10000"` // 10 seconds ImagebuilderImagePullPolicy string `envconfig:"IMAGEBUILDER_IMAGE_PULL_POLICY" default:"Always"` BuilderPodNodeSelector string `envconfig:"BUILDER_POD_NODE_SELECTOR" default:""` }
Config is the envconfig (http://github.com/kelseyhightower/envconfig) compatible struct for the builder's git-receive hook.
func (Config) App ¶
App returns the application name represented by c. The app name is the same as c.Repository with the last '.' and beyond stripped off.
func (Config) BuilderPodTickDuration ¶
BuilderPodTickDuration returns the size of the interval used to check for the end of the execution of a Pod building an application.
func (Config) BuilderPodWaitDuration ¶
BuilderPodWaitDuration returns the maximum time to wait for the end of the execution of a Pod building an application.
func (*Config) CheckDurations ¶
func (c *Config) CheckDurations()
CheckDurations checks if ticks for builder and object storage are not bigger than the maximum duration. In case of this it will set the tick to the default.
func (Config) ObjectStorageTickDuration ¶
ObjectStorageTickDuration returns the size of the interval used to check for the end of an operation that involves the object storage.
func (Config) ObjectStorageWaitDuration ¶
ObjectStorageWaitDuration returns the maximum time to wait for the end of an operation that involves the object storage.
func (Config) SessionIdleInterval ¶
SessionIdleInterval returns the ticker interval to wait for status