gitea

package
v0.50.1 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gitea

type Gitea struct {
	// Spec contains inputs coming from updatecli configuration
	Spec Spec

	HeadBranch string
	// contains filtered or unexported fields
}

Gitea contains information to interact with Gitea api

func New

func New(spec interface{}, pipelineID string) (*Gitea, error)

New returns a new valid Gitea object.

func (*Gitea) Add

func (g *Gitea) Add(files []string) error

Add run `git add`.

func (*Gitea) Checkout

func (g *Gitea) Checkout() error

Checkout create and then uses a temporary git branch.

func (*Gitea) Clean

func (g *Gitea) Clean() error

Clean deletes github working directory.

func (*Gitea) Clone

func (g *Gitea) Clone() (string, error)

Clone run `git clone`.

func (*Gitea) Commit

func (g *Gitea) Commit(message string) error

Commit run `git commit`.

func (*Gitea) GetChangedFiles

func (g *Gitea) GetChangedFiles(workingDir string) ([]string, error)

func (*Gitea) GetDirectory

func (g *Gitea) GetDirectory() (directory string)

GetDirectory returns the local git repository path.

func (*Gitea) IsRemoteBranchUpToDate added in v0.45.0

func (g *Gitea) IsRemoteBranchUpToDate() (bool, error)

IsRemoteBranchUpToDate checks if the branche reference name is published on on the default remote

func (*Gitea) Push

func (g *Gitea) Push() error

Push run `git push` to the corresponding Gitea remote branch if not already created.

func (*Gitea) PushBranch added in v0.44.0

func (g *Gitea) PushBranch(branch string) error

PushBranch push branch

func (*Gitea) PushTag

func (g *Gitea) PushTag(tag string) error

PushTag push tags

func (*Gitea) SearchTags

func (g *Gitea) SearchTags() (tags []string, err error)

Retrieve git tags from a remote gitea repository

type Spec

type Spec struct {
	client.Spec `yaml:",inline,omitempty"`
	// CommitMessage represents conventional commit metadata as type or scope, used to generate the final commit message.
	CommitMessage commit.Commit `yaml:",omitempty"`
	// Directory specifies where the github repository is cloned on the local disk
	Directory string `yaml:",omitempty"`
	// Email specifies which emails to use when creating commits
	Email string `yaml:",omitempty"`
	// Force is used during the git push phase to run `git push --force`.
	Force bool `yaml:",omitempty"`
	// GPG key and passphrased used for commit signing
	GPG sign.GPGSpec `yaml:",omitempty"`
	// Owner specifies repository owner
	Owner string `yaml:",omitempty" jsonschema:"required"`
	// Repository specifies the name of a repository for a specific owner
	Repository string `yaml:",omitempty" jsonschema:"required"`
	// User specifies the user of the git commit messages
	User string `yaml:",omitempty"`
	// Branch specifies which Gitea repository branch to work on
	Branch string `yaml:",omitempty"`
}

Spec defines settings used to interact with Gitea release

func (*Spec) Validate

func (s *Spec) Validate() error

Jump to

Keyboard shortcuts

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