utils

package
v0.0.0-...-574bc26 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallGit

func CallGit(params ...string) error

CallGit and pass given params as git command line client parameters

func CloneOrPullRepo

func CloneOrPullRepo(cfg Config, repoURL, repoPath string, resetOnFailedPull bool)

CloneOrPullRepo from remote If the given repo exists locally it will try to pull (no force!) the repo (in order to update it) if it doesn't exist, it will clone the repo. If resetOnFailedPull is set to true it will call a 'git reset --hard' if the preceding pull command failed

func CloneRepo

func CloneRepo(cfg Config, repoURL, repoPath string)

CloneRepo from remote

func CommitAndPush

func CommitAndPush(repoPath string)

CommitAndPush to git repo

func Exists

func Exists(name string) bool

Exists file?

func GetRepositoryHTTPSUrl

func GetRepositoryHTTPSUrl(cfg Config, git Git) string

GetRepositoryHTTPSUrl for GitHub repo

func GetRepositoryNameFromURL

func GetRepositoryNameFromURL(url string) string

GetRepositoryNameFromURL only works on GitHub repos

func GetRepositorySSHUrl

func GetRepositorySSHUrl(cfg Config, git Git) string

GetRepositorySSHUrl for GitHub repo

func IsGitInstalled

func IsGitInstalled() bool

IsGitInstalled check whether git command line client is accessible on local machine

func PullRepo

func PullRepo(repoPath string) error

PullRepo from remote

func TimeTrack

func TimeTrack(start time.Time, name string)

TimeTrack tracks performance runtime and logs it out Call: defer utils.TimeTrack(time.Now(), "Some meaningful comment")

Types

type Config

type Config struct {
	Github struct {
		AccessToken               string `json:"access_token,omitempty"`
		BaseURL                   string `json:"base_url"`
		CreateLinksInBacklogItems bool   `json:"createLinksInBacklogItems,omitempty"`
	} `json:"github,omitempty"`
	Jira struct {
		BaseURL   string `json:"base_url,omitempty"`
		BasicAuth struct {
			User     string `json:"user"`
			Password string `json:"password"`
		} `json:"basicAuth,omitempty"`
		CreateLinksInBacklogItems bool `json:"createLinksInBacklogItems,omitempty"`
	} `json:"jira,omitempty"`
	Sourcecode []Sourcecode
	Mapping    struct {
		Local string
	}
	TestReport []struct {
		Type  string
		Local string
	}
	TraceabilityRepo struct {
		Git Git
	}
	Delivery struct {
		Program      string
		Version      string
		Backlogitems string
	}
	WorkDir   string
	OutputDir string
	Log       struct {
		Level string
	}
}

Config struct representation of your JSON config file

func (*Config) ReadConfig

func (cfg *Config) ReadConfig(configFilePath *string)

ReadConfig from json file

func (*Config) ReadDelivery

func (cfg *Config) ReadDelivery(deliveryFilePath *string)

ReadDelivery from json file

type Git

type Git struct {
	Organization string
	Repository   string
	Branch       string `json:"branch"`
}

Git coordinates

type Sourcecode

type Sourcecode struct {
	Local             string
	Git               Git
	Language          string
	CustomURLTemplate string
}

Sourcecode location (local and/or remote) and coding language

Jump to

Keyboard shortcuts

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