gitea_publish_golang

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CliNameGiteaPublishGolangApiKey = "settings.gitea-publish-golang-api-key"
	EnvGiteaPublishGolangApiKey     = "PLUGIN_GITEA_PUBLISH_GOLANG_API_KEY"

	CliNameGiteaPubGolangBaseUrl = "settings.gitea-publish-golang-base-url"
	EnvGiteaPubGolangBaseUrl     = "PLUGIN_GITEA_PUBLISH_GOLANG_BASE_URL"

	CliNameGiteaPubGolangInsecure = "settings.gitea-publish-golang-insecure"
	EnvGiteaPubGolangInsecure     = "PLUGIN_GITEA_PUBLISH_GOLANG_INSECURE"

	CliNameGiteaPubGolangDryRun = "settings.gitea-publish-golang-dry-run"
	EnvGiteaPubGolangDryRun     = "PLUGIN_GITEA_PUBLISH_GOLANG_DRY_RUN"

	CliNameGiteaPubGolangPathGo = "settings.gitea-publish-golang-path-go"
	EnvGiteaPubGolangPathGo     = "PLUGIN_GITEA_PUBLISH_GOLANG_PATH_GO"

	CliNameGiteaPubGolangRemovePaths = "settings.gitea-publish-golang-remove-paths"
	EnvGiteaPubGolangRemovePaths     = "PLUGIN_GITEA_PUBLISH_GOLANG_REMOVE_PATHS"

	CliNameGiteaPubGolangUpdateResultRootPath = "settings.gitea-publish-golang-update-result-root-path"
	EnvGiteaPubGolangUpdateResultRootPath     = "PLUGIN_GITEA_PUBLISH_GOLANG_UPDATE_RESULT_ROOT_PATH"

	CliNameGiteaPubGolangUpdateResultFileName = "settings.gitea-publish-golang-update-result-file-name"
	EnvGiteaPubGolangUpdateResultFileName     = "PLUGIN_GITEA_PUBLISH_GOLANG_UPDATE_RESULT_FILE_NAME"
)
View Source
const (
	CliNameGiteaPubGolangTimeoutSecond = "settings.gitea-publish-golang-timeout-second"
	EvnGiteaPubGolangTimeoutSecond     = "PLUGIN_GITEA_PUBLISH_GOLANG_TIMEOUT_SECOND"
)

Variables

View Source
var (
	ErrMissingTag = fmt.Errorf("NewGiteaPublishGolangClientByWoodpeckerShort missing tag, please check now in tag build")
)
View Source
var (
	ErrPackageNotExist = fmt.Errorf("RemotePackageGoFetch not exist, code 404")
)

Functions

func GlobalFlag

func GlobalFlag() []cli.Flag

GlobalFlag Other modules also have flags

func HideGlobalFlag

func HideGlobalFlag() []cli.Flag

Types

type FuncGiteaPublishGolang

type FuncGiteaPublishGolang interface {
	ShortInfo() wd_short_info.WoodpeckerInfoShort

	SetWoodpeckerInfo(info wd_info.WoodpeckerInfo)
	GetWoodPeckerInfo() wd_info.WoodpeckerInfo

	OnlyArgsCheck()

	Exec() error
	// contains filtered or unexported methods
}

type GiteaPackageInfo

type GiteaPackageInfo struct {
	Id      uint64 `json:"id"`
	Type    string `json:"type"`
	Name    string `json:"name"`
	Version string `json:"version"`
}

type GiteaPublishGolang

type GiteaPublishGolang struct {
	Name    string
	Version string

	Settings Settings

	FuncPlugin FuncGiteaPublishGolang `json:"-"`
	// contains filtered or unexported fields
}

GiteaPublishGolang gitea_publish_golang all config

func BindCliFlags

func BindCliFlags(c *cli.Context,
	debug bool,
	cliName, cliVersion string,
	wdInfo *wd_info.WoodpeckerInfo,
	rootPath,
	stepsTransferPath string, stepsOutDisable bool,
) (*GiteaPublishGolang, error)

func (*GiteaPublishGolang) Exec

func (p *GiteaPublishGolang) Exec() error

func (*GiteaPublishGolang) GetWoodPeckerInfo

func (p *GiteaPublishGolang) GetWoodPeckerInfo() wd_info.WoodpeckerInfo

func (*GiteaPublishGolang) OnlyArgsCheck

func (p *GiteaPublishGolang) OnlyArgsCheck()

func (*GiteaPublishGolang) SetWoodpeckerInfo

func (p *GiteaPublishGolang) SetWoodpeckerInfo(info wd_info.WoodpeckerInfo)

SetWoodpeckerInfo also change ShortInfo() return

func (*GiteaPublishGolang) ShortInfo

type GiteaPublishGolangClient

type GiteaPublishGolangClient interface {
	LocalPackageGoFetch(goModRootPath string) error

	RemotePackageGoFetch(version string) (*GiteaPackageInfo, error)

	CreateGoModZip(version string, zipRootPath string, goModRootPath string, removePath []string) error

	PackageGoUpload() (*PublishPackageGoInfo, error)
}

func NewGiteaPublishGolangClientByWoodpeckerShort

func NewGiteaPublishGolangClientByWoodpeckerShort(info wd_short_info.WoodpeckerInfoShort, config Settings) (GiteaPublishGolangClient, error)

NewGiteaPublishGolangClientByWoodpeckerShort create gitea publish golang client by wd_short_info.WoodpeckerInfoShort

type GoModZip

type GoModZip struct {
	GoModZipFunc GoModZipFunc `json:"-"`
	// contains filtered or unexported fields
}

func NewGoModZip

func NewGoModZip(modRootPath string) (*GoModZip, error)

func (*GoModZip) CreateGoModeZipPackageFile

func (z *GoModZip) CreateGoModeZipPackageFile(targetPath string, version string) error

func (*GoModZip) GetGoModPackageName

func (z *GoModZip) GetGoModPackageName() string

func (*GoModZip) GetGoModeGoVersion

func (z *GoModZip) GetGoModeGoVersion() string

func (*GoModZip) GetModFile

func (z *GoModZip) GetModFile() *modfile.File

func (*GoModZip) GetVersionName

func (z *GoModZip) GetVersionName() string

func (*GoModZip) GetZipPackageFilePath

func (z *GoModZip) GetZipPackageFilePath() (string, error)

type GoModZipFunc

type GoModZipFunc interface {
	GetModFile() *modfile.File

	GetVersionName() string

	GetGoModPackageName() string

	GetGoModeGoVersion() string

	CreateGoModeZipPackageFile(targetPath string, version string) error

	GetZipPackageFilePath() (string, error)
}

type PublishPackageGoInfo

type PublishPackageGoInfo struct {
	ModVersion     module.Version `json:"-"`
	Version        string
	PackageName    string
	GoModGoVersion string

	HostName       string
	PackagePageUrl string
	UploadTimeUnix int64
}

type Settings

type Settings struct {
	Debug             bool
	TimeoutSecond     uint
	StepsTransferPath string
	StepsOutDisable   bool
	RootPath          string

	DryRun             bool
	GiteaApiKey        string
	GiteaBaseUrl       string
	GiteaInsecure      bool
	GiteaTimeoutSecond uint

	PublishPackageGoPath string

	PublishRemovePaths   []string
	ResultUploadRootPath string

	ResultUploadFileName string

	// PublishPackageVersion is the version to publish this by check args success will init by tag or latest
	PublishPackageVersion string

	// ZipTargetRootPath    is the root path of zip target with check args success will init by
	// tempDir/woodpecker-gitea-publisher-golang/{repo-hostname}/{owner}/{repo}/{build_number}
	ZipTargetRootPath string
	// contains filtered or unexported fields
}

Settings gitea_publish_golang private config

Jump to

Keyboard shortcuts

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