settings

package
v0.0.0-...-1dd5a45 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: Apache-2.0 Imports: 10 Imported by: 4

Documentation

Index

Constants

View Source
const (
	InitialVersion = "0.0.0+git"
	VersionFile    = "VERSION"
)

Variables

This section is empty.

Functions

func GetProjectName

func GetProjectName(log *logging.Logger, projectDir string) (string, error)

Try to read project name

func GetProjectOrganizationName

func GetProjectOrganizationName(log *logging.Logger, projectDir string) (string, error)

Try to read project's organization name (e.g. 'pulcy')

func GetProjectOrganizationPath

func GetProjectOrganizationPath(log *logging.Logger, projectDir string) (string, error)

Try to read project's organization path (e.g. 'github.com/pulcy')

func GetProjectSiblingURL

func GetProjectSiblingURL(log *logging.Logger, projectDir, siblingName string) (string, error)

Try to return the URL of a project's sibling project (e.g. 'git@github.com:pulcy/sibling.git')

func ReadVersion

func ReadVersion(projectDir string) (string, error)

Try to read VERSION

Types

type GithubAsset

type GithubAsset struct {
	RelPath string `json:"path"`            // Relative path to asset file
	Label   string `json:"label,omitempty"` // Optional label of file
}

type ProjectSettings

type ProjectSettings struct {
	Image           string `json:"image"`                // Docker image name
	Registry        string `json:"registry"`             // Docker registry prefix
	Namespace       string `json:"namespace"`            // Docker namespace prefix
	NoGrunt         bool   `json:"no-grunt"`             // If set, grunt won't be called even if there is a Gruntfile.js
	TagLatest       bool   `json:"tag-latest"`           // If set, a latest tag will be set of the docker image
	TagMajorVersion bool   `json:"tag-major-version"`    // If set, a tag will be set to the major version of the docker image (e.g. myimage:3)
	TagMinorVersion bool   `json:"tag-minor-version"`    // If set, a tag will be set to the minor version of the docker image (e.g. myimage:3.2)
	GitBranch       string `json:"git-branch,omitempty"` // If set, this branch is expected (defaults to master)
	Targets         struct {
		CleanTarget   string `json:"clean,omitempty"`
		ReleaseTarget string `json:"release,omitempty"`
	} `json:"targets"`
	ManifestFiles    []string      `json:"manifest-files"`     // Additional manifest files
	GoVendorDir      string        `json:"go-vendor-dir"`      // If set, use this instead of `./vendor` as vendor directory.
	GradleConfigFile string        `json:"gradle-config-file"` // If set, creates a file with this path containing the current version
	GithubAssets     []GithubAsset `json:"github-assets"`      // If set, creates a github release with given assets.
}

func Read

func Read(dir string) (*ProjectSettings, error)

Read tries to read .pulcy settings file. If found the unmarshaled settings are returned, if not found nil is returned.

Jump to

Keyboard shortcuts

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