internal

package
v0.0.0-...-61829c1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnvVarRef              = "PROJECT_REF"
	EnvVarBuildRef         = "CI_COMMIT_SHA"
	EnvVarBuildBranch      = "CI_COMMIT_REF"
	EnvVarRancherEnv       = "RANCHER_ENVIRONMENT"
	EnvVarRancherUrl       = "RANCHER_URL"
	EnvVarRancherAccessKey = "RANCHER_ACCESS_KEY"
	EnvVarRancherSecretKey = "RANCHER_SECRET_KEY"
)
View Source
var (
	EnvValRancherUrl       = "http://rancher.profzone.net:38080"
	EnvValRancherAccessKey = "744E0D8EF311C269FED1"
	EnvValRancherSecretKey = "yBXzp7jdaaRqCtL92TJSRbekxzYr8x7Xr2r5rq11"
)
View Source
var (
	CIWorkingDirectory  = "/drone/workspace"
	CIGolangRootPath    = "/go/src"
	COGolangPackageName = "github.com/johnnyeven"
)
View Source
var (
	DOCKER_REGISTRY_KEY = "PROFZONE_DOCKER_REGISTRY"
	DOCKER_REGISTRY     = "registry.profzone.net:5000"
)
View Source
var DockerfileYmlOrders = []string{
	"dockerfile.default.yml",
	"dockerfile.yml",
}
View Source
var ProjectFile = "profzone.yml"
View Source
var VersionRegexp = regexp.MustCompile("(\\d+)\\.(\\d+)\\.(\\d+)")

Functions

func CommandForDeploy

func CommandForDeploy(p *Project, deployEnv string) (command *exec.Cmd)

func CommandsForGoBuilder

func CommandsForGoBuilder(p *Project) (commands []*exec.Cmd)

func CommandsForImageBuilder

func CommandsForImageBuilder(p *Project, push bool) (commands []*exec.Cmd)

func LoadEnv

func LoadEnv(envName string, feature string)

func SetEnv

func SetEnv(k string, v string)

func WrapEnv

func WrapEnv(s string) string

Types

type Project

type Project struct {
	Name            string            `env:"name" yaml:"name"`
	Group           string            `env:"group" yaml:"group,omitempty"`
	Version         Version           `env:"version" yaml:"version"`
	Desc            string            `env:"description" yaml:"description"`
	ProgramLanguage string            `env:"program_language" yaml:"program_language"`
	Scripts         map[string]Script `yaml:"scripts,omitempty"`
	Feature         string            `yaml:"feature,omitempty"`
}

func (*Project) Command

func (p *Project) Command(args ...string) *exec.Cmd

func (*Project) Execute

func (p *Project) Execute(args ...string)

func (*Project) Run

func (p *Project) Run(commands ...*exec.Cmd)

func (*Project) SetEnviron

func (p *Project) SetEnviron()

func (*Project) UnmarshalFromFile

func (p *Project) UnmarshalFromFile() error

func (Project) WithDesc

func (p Project) WithDesc(desc string) Project

func (Project) WithFeature

func (p Project) WithFeature(f string) Project

func (Project) WithGroup

func (p Project) WithGroup(group string) Project

func (Project) WithLanguage

func (p Project) WithLanguage(pl string) Project

func (Project) WithName

func (p Project) WithName(name string) Project

func (Project) WithScripts

func (p Project) WithScripts(key string, scripts ...string) Project

func (Project) WithVersion

func (p Project) WithVersion(s string) Project

func (*Project) WriteToFile

func (p *Project) WriteToFile()

type Script

type Script []string

func (Script) IsZero

func (s Script) IsZero() bool

func (Script) MarshalYAML

func (s Script) MarshalYAML() (interface{}, error)

func (Script) String

func (s Script) String() string

func (*Script) UnmarshalYAML

func (s *Script) UnmarshalYAML(unmarshal func(interface{}) error) error

type Version

type Version struct {
	Latest bool
	Suffix string
	Prefix string
	Major  int
	Minor  int
	Patch  int
}

func FromVersionString

func FromVersionString(s string) (*Version, error)

func (Version) IncreaseMajor

func (v Version) IncreaseMajor() Version

func (Version) IncreaseMinor

func (v Version) IncreaseMinor() Version

func (Version) IncreasePatch

func (v Version) IncreasePatch() Version

func (Version) IsStable

func (v Version) IsStable() bool

func (Version) MarshalYAML

func (v Version) MarshalYAML() (interface{}, error)

func (Version) String

func (v Version) String() string

func (*Version) UnmarshalYAML

func (v *Version) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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