mgp

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Log

func Log(msg string)

Log logs message if verbose mode is on.

func Logf

func Logf(msg string, v ...interface{})

Logf logs message if verbose mode is on.

Types

type MageProject

type MageProject struct {
	// contains filtered or unexported fields
}

MageProject provides Mage dependent high level targets to reuse as is

func NewMageProject

func NewMageProject(workdir, projectName, packageName string, options ...MageProjectOption) *MageProject

NewMageProject constructs a new MageProject instance

func (*MageProject) Build

func (p *MageProject) Build() error

Build builds binary in build dir

func (*MageProject) BuildWithDocker

func (p *MageProject) BuildWithDocker() error

BuildWithDocker builds binary in build dir using a Dockerfile.build file

func (*MageProject) ChangeLog

func (p *MageProject) ChangeLog() error

ChangeLog generates a ChangeLog based on git history

func (*MageProject) Clean

func (p *MageProject) Clean() error

Clean removes the build directory

func (*MageProject) CleanAll

func (p *MageProject) CleanAll() error

CleanAll removes the build directory and the docker image used for build

func (*MageProject) Deploy

func (p *MageProject) Deploy() error

Deploy deploys cross platform binaries to artifacts registry

func (*MageProject) DockerBuildImage

func (p *MageProject) DockerBuildImage() error

DockerBuildImage builds Docker image

func (*MageProject) DockerPushImage

func (p *MageProject) DockerPushImage() error

DockerPushImage pushes Docker image to a repository

func (*MageProject) MageLibrary

func (p *MageProject) MageLibrary() *mgl.MageLibrary

MageLibrary gets Mage library used by this project

func (*MageProject) Package

func (p *MageProject) Package() error

Package packages cross platform binaries in build dir

func (*MageProject) PrintInfo

func (p *MageProject) PrintInfo() string

PrintInfo prints information used internally

func (*MageProject) Release

func (p *MageProject) Release() error

Release creates a git tag and push it to remote

func (*MageProject) Test

func (p *MageProject) Test() error

Test runs tests with go test

func (*MageProject) Validate

func (p *MageProject) Validate() error

Validate runs go format and linters

type MageProjectOption

type MageProjectOption func(*MageProject)

MageProjectOption defines an operation which set an option

func WithArtifactURL

func WithArtifactURL(val string) MageProjectOption

WithArtifactURL sets artifactURL to value

func WithBuildDir

func WithBuildDir(val string) MageProjectOption

WithBuildDir sets buildDir to value

func WithCompileFlags

func WithCompileFlags(val string) MageProjectOption

WithCompileFlags sets ldFlags to value

func WithDockerAppPath

func WithDockerAppPath(val string) MageProjectOption

WithDockerAppPath sets dckAppPath to value

func WithDockerImage

func WithDockerImage(val string) MageProjectOption

WithDockerImage sets dckImage to value

func WithDockerRegistry

func WithDockerRegistry(val string) MageProjectOption

WithDockerRegistry sets dckRegistry to value

func WithGitURL

func WithGitURL(val string) MageProjectOption

WithGitURL sets gitURL to value

func WithGroupName

func WithGroupName(val string) MageProjectOption

WithGroupName sets groupName to value

func WithTestFlags

func WithTestFlags(val string) MageProjectOption

WithTestFlags sets testFlags to value

Jump to

Keyboard shortcuts

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