option

package
v0.0.0-...-53d016b Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// store in host
	STORAGE_TYPE_LOCAL = "local"
	// aliyun oss
	STORAGE_TYPE_OSS = "oss"
	// tencent cloud cos
	STORAGE_TYPE_COS = "cos"
	// aws s3
	STORAGE_TYPE_AWS_S3 = "aws-s3"
)

Variables

This section is empty.

Functions

func BuildStatus2Int

func BuildStatus2Int(status string) int

trans string status to fuhsi-server build status (int)

Types

type Cfg

type Cfg struct {
	Version string
	Locale  string

	JenkinsPkgWorkspace string
	StorageType         string
	PkgRootPath         string

	Oss struct {
		Endpoint     string
		AccessKey    string
		AccessSecret string
		Bucket       string
	}

	// interaction api with nvwa server
	NvwaApi struct {
		BuildInfo     string
		Notify        string
		UploadPackage string
	}
}

type JenkinsEnv

type JenkinsEnv struct {
	// the app's workspace path
	Workspace string

	// jenkins home
	JenkinsHome string

	// jenkins build number
	BuildNumber string

	// job name, e.g: app-demo-01
	JobName string

	// jenkins-${JOB_NAME}-${BUILD_NUMBER}
	BuildTag string

	// git branch
	GitBranch string

	// git Commit ID
	GitCommit string

	// SVN_REVISION
	SvnRevision string

	// user who launch this build
	BuildUserId string
}

jenkins environment variables

func GetJenkinsEnv

func GetJenkinsEnv() *JenkinsEnv

type Option

type Option struct {
	// configuration fields
	Cfg *Cfg

	JenkinsEnv *JenkinsEnv

	// config file path
	ConfFile string

	// app name, same as app created in fuhsi-server
	App string

	Tar struct {
		// fuhsi-server build id
		BuildId int64

		// assign files or dir to pack
		// package name e.g: {project}.{buildId}.{branch}.{commitId}.{time}.tar.gz
		Files []string

		// exclude files
		Excludes []string
	}

	BuildInfo struct {
		// fuhsi-server build id
		BuildId int64

		// status of build
		Status string
	}

	Notify struct {
		// fuhsi-server build id
		BuildId int64

		// notify message content
		Message string

		// notify users, username register in fuhsi-server
		NotifyUser []string
	}

	Push struct {
		// fuhsi-server build id
		BuildId int64

		// package to push
		VersionPkg string
	}

	Pull struct {
		// package to pull
		VersionPkg string
	}
}

func NewOption

func NewOption() *Option

func (*Option) Config

func (t *Option) Config()

init config from config file

Jump to

Keyboard shortcuts

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