gitImpl

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package gitImpl provides the implementation of the zedpm-plugin-git plugin.

Index

Constants

View Source
const (
	PropertyGitIgnoreDirty = "git.ignoreDirty"
)

Variables

This section is empty.

Functions

func GetPropertyGitIgnoreDirty added in v0.1.0

func GetPropertyGitIgnoreDirty(ctx context.Context) bool

GetPropertyGitIgnoreDirty gets the setting, that when true, allows the minting to proceed even when the directory is dirty.

func IsDirty

func IsDirty(status git.Status) bool

IsDirty returns true if we consider the tree dirty. We do not consider Untracked to dirty the directory and we also ignore some filenames that are in the global .gitignore and not in the local .gitignore.

Types

type Plugin

type Plugin struct{}

Plugin implements the plugin.Interface for performing tasks related to git.

func (*Plugin) Cancel

func (p *Plugin) Cancel(ctx context.Context, task plugin.Task) error

Cancel is a no-op.

func (*Plugin) Complete

func (p *Plugin) Complete(ctx context.Context, task plugin.Task) error

Complete is a no-op.

func (*Plugin) Goal

Goal returns plugin.ErrUnsupportedGoal.

func (*Plugin) Implements

func (p *Plugin) Implements(context.Context) ([]plugin.TaskDescription, error)

Implements provides task descriptions for /release/mint/git and /release/publish/git tasks.

func (*Plugin) Prepare

func (p *Plugin) Prepare(
	ctx context.Context,
	task string,
) (plugin.Task, error)

Prepare returns plugin.Task implementations for the implemented tasks.

type ReleaseMintTask

type ReleaseMintTask struct {
	plugin.TaskBoilerplate
	zGit.Git
}

ReleaseMintTask implements the /release/mint/git task.

func (*ReleaseMintTask) AddAndCommit

func (s *ReleaseMintTask) AddAndCommit(ctx context.Context) error

AddAndCommit adds changes made as part of the release process to the release branch.

func (*ReleaseMintTask) Check

func (s *ReleaseMintTask) Check(ctx context.Context) error

Check calls CheckGitCleanliness.

func (*ReleaseMintTask) CheckGitCleanliness

func (s *ReleaseMintTask) CheckGitCleanliness(ctx context.Context) error

CheckGitCleanliness ensures that the current git repository is clean and that we are on the correct branch from which to trigger a release.

func (*ReleaseMintTask) End

End sets up the AddAndCommit and PushReleaseBranch operations.

func (*ReleaseMintTask) MakeReleaseBranch

func (s *ReleaseMintTask) MakeReleaseBranch(ctx context.Context) error

MakeReleaseBranch creates the branch that will be used to manage the release.

func (*ReleaseMintTask) PushReleaseBranch

func (s *ReleaseMintTask) PushReleaseBranch(ctx context.Context) error

PushReleaseBranch pushes the release branch to github for release testing.

func (*ReleaseMintTask) Run

Run sets up the MakeReleaseBranch operation.

func (*ReleaseMintTask) Setup

func (s *ReleaseMintTask) Setup(ctx context.Context) error

Setup initializes the git client and related objects.

type ReleasePublishTask

type ReleasePublishTask struct {
	plugin.TaskBoilerplate
	zGit.Git
}

ReleasePublishTask implements the /release/publish/git task.

func (*ReleasePublishTask) End

End sets up the TagRelease operation to run.

func (*ReleasePublishTask) Setup

func (f *ReleasePublishTask) Setup(ctx context.Context) error

Setup initializes the git client and related objects.

func (*ReleasePublishTask) TagRelease

func (f *ReleasePublishTask) TagRelease(ctx context.Context) error

TagRelease creates and pushes a tag for the newly merged release on master.

Jump to

Keyboard shortcuts

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