app

package
v0.0.0-...-82bfca7 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package app is the main application

Index

Constants

This section is empty.

Variables

View Source
var (
	// Config struct
	Config struct {
		// ComposerPath binary path
		ComposerPath string

		// ComposerFlags composer flags
		ComposerFlags []string

		// ComposerLockFile file path
		ComposerLockFile string

		// GitPath binary path
		GitPath string

		// Repo is the directory where the repository is
		RepoDir string

		// GitUser username
		GitUser string

		// GitEmail username
		GitEmail string

		// GitBranch branch name
		GitBranch string

		// MRBranch is the branch name for the merge request
		MRBranch string

		// MRTitlePrefix is the first part of the merge request title
		MRTitlePrefix string

		// GitCommitTitle is the first line of the git commit message
		GitCommitTitle string
	}
)

Functions

func BuildConfig

func BuildConfig()

BuildConfig will ensure the correct parameters are set

func ComposerUpdate

func ComposerUpdate() (string, error)

ComposerUpdate will update composer

func CreateMergeBranch

func CreateMergeBranch(diff ComposerDiff) error

CreateMergeBranch creates the merge branch using git

func CreateMergeRequest

func CreateMergeRequest(title, description string) error

CreateMergeRequest will create a merge request for the branch setting the title, description and other options

func MRExists

func MRExists(checksum string) bool

MRExists checks to see if an existing merge request exists based on checksum of the content

func RemoveOldMRs

func RemoveOldMRs() error

RemoveOldMRs will remove old merge requests (if enabled) by deleting the branches

func SwitchBranch

func SwitchBranch(branch string) error

SwitchBranch will switch to a branch

Types

type ComposerDiff

type ComposerDiff struct {
	Checksum      string
	Packages      []ComposerDiffPackage
	Description   string
	CommitMessage string
}

ComposerDiff struct

func CompareDiffs

func CompareDiffs(pre, post ComposerLock) ComposerDiff

CompareDiffs will return a ComposerDiff struct for parsing

type ComposerDiffPackage

type ComposerDiffPackage struct {
	Name        string
	PreVersion  string
	PostVersion string //
	URL         string // url
	CompareURL  string // url
}

ComposerDiffPackage struct

type ComposerLock

type ComposerLock struct {
	Checksum    string
	Packages    []Package `json:"packages"`
	PackagesDev []Package `json:"packages-dev"`
}

ComposerLock struct

func ParseComposerLock

func ParseComposerLock() (ComposerLock, error)

ParseComposerLock parses a composer lock file

type Package

type Package struct {
	Name    string `json:"name"`
	Version string `json:"version"`
	Source  struct {
		Type      string `json:"type"`
		URL       string `json:"url"`
		Reference string `json:"reference"`
	} `json:"source"`
	Homepage string `json:"homepage,omitempty"`
}

Package struct for composer

Jump to

Keyboard shortcuts

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