Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Conf Main (other var from init) Conf = Config{ Env: &EnvVar{ File: strings.TrimSpace("/opt/.env"), Project: strings.TrimSpace(os.Getenv("RD_JOB_PROJECT")), AppName: strings.TrimSpace(os.Getenv("RD_OPTION_APP_NAME")), EnvName: strings.TrimSpace(os.Getenv("RD_OPTION_ENV_NAME")), GitVer: strings.TrimSpace(os.Getenv("RD_OPTION_GIT_VERSION")), CodeType: strings.TrimSpace(os.Getenv("RD_OPTION_CODE_TYPE")), }, Git: new(IniGit), Kube: new(IniK8s), Path: new(IniPath), Harbor: new(IniHarbor), File: new(FileBuild), } // ImageName build image ImageName string )
Functions ¶
func CheckIfError ¶
func CheckIfError(err error)
CheckIfError should be used to naively panics if an error is not nil.
Types ¶
type Config ¶
type Config struct { Env *EnvVar Git *IniGit Kube *IniK8s Path *IniPath Harbor *IniHarbor File *FileBuild }
Config Main struct
type DockerClient ¶
type DockerClient struct { Username string Password string Address string Auth string Ctx context.Context Cli *client.Client }
DockerClient Cli
func (*DockerClient) Compile ¶
func (d *DockerClient) Compile()
Compile such as `mvn clean / yarn install`
type EnvVar ¶
type EnvVar struct { File string // environment file Project string // project name AppName string // application name EnvName string // environment name GitVer string // code version CodeType string // code build type }
EnvVar env struct
type FileBuild ¶
type FileBuild struct { GitAddr string `file:"GIT_ADDRESS"` // code addr BuilderImage string `file:"BUILDER"` // build image BuilderOpts string `file:"BUILDER_OPTS"` // build opts CopyFiles []string `file:"Dockerfile"` // `COPY`/`ADD` params }
FileBuild file struct
type IniGit ¶
type IniGit struct {
PrivateKey string `ini:"id_rsa"` // code info
}
IniGit git struct
type IniHarbor ¶
type IniHarbor struct { User string `ini:"user"` // user name Pass string `ini:"pass"` // user pass Addr string `ini:"addr"` // harbor addr Dist string `ini:"dist"` // harbor dist }
IniHarbor harbor struct
type IniK8s ¶
type IniK8s struct {
KubeConfig string `ini:"config"` // kube config
}
IniK8s k8s struct
type IniPath ¶
type IniPath struct { Runtime string `ini:"runtime"` // runtime dir Workdir string `ini:"workdir"` // workspace dir }
IniPath path struct
type KubeClient ¶
type KubeClient struct { NameSpace string AppName string ImageName string Ctx context.Context Cli *kubernetes.Clientset }
KubeClient Cli
Click to show internal directories.
Click to hide internal directories.