Documentation
¶
Overview ¶
Package git contains functions for interacting with git repositories.
Package git contains functions for interacting with git repositories.
Package git contains functions for interacting with git repositories.
Package git contains functions for interacting with git repositories.
Package git contains functions for interacting with git repositories.
Package git contains functions for interacting with git repositories.
Index ¶
- func ParseRef(r string) plumbing.ReferenceName
- func UpdateGiteaPVC(shouldRollBack bool) (string, error)
- type CreateTokenResponse
- type Git
- func (g *Git) CheckoutTag(tag string) error
- func (g *Git) CreatePackageRegistryToken() (CreateTokenResponse, error)
- func (g *Git) CreateReadOnlyUser() error
- func (g *Git) DoHTTPThings(request *netHttp.Request, username, secret string) ([]byte, int, error)
- func (g *Git) DownloadRepoToTemp(gitURL string) error
- func (g *Git) Pull(gitURL, targetFolder string, shallow bool) error
- func (g *Git) PushRepo(srcURL, targetFolder string) error
- func (g *Git) UpdateGitUser(oldAdminPass string, username string, userpass string) error
- func (g *Git) UpdateJackalGiteaUsers(oldState *types.JackalState) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseRef ¶
func ParseRef(r string) plumbing.ReferenceName
ParseRef parses the provided ref into a ReferenceName if it's not a hash.
func UpdateGiteaPVC ¶
UpdateGiteaPVC updates the existing Gitea persistent volume claim and tells Gitea whether to create or not.
Types ¶
type CreateTokenResponse ¶
type CreateTokenResponse struct { ID int64 `json:"id"` Name string `json:"name"` Sha1 string `json:"sha1"` TokenLastEight string `json:"token_last_eight"` }
CreateTokenResponse is the response given from creating a token in Gitea
type Git ¶
type Git struct { // Server is the git server configuration. Server types.GitServerInfo // Spinner is an optional spinner to use for long running operations. Spinner *message.Spinner // Target working directory for the git repository. GitPath string }
Git is the main struct for managing git repositories.
func New ¶
func New(server types.GitServerInfo) *Git
New creates a new git instance with the provided server config.
func NewWithSpinner ¶
func NewWithSpinner(server types.GitServerInfo, spinner *message.Spinner) *Git
NewWithSpinner creates a new git instance with the provided server config and spinner.
func (*Git) CheckoutTag ¶
CheckoutTag performs a `git checkout` of the provided tag to a detached HEAD.
func (*Git) CreatePackageRegistryToken ¶
func (g *Git) CreatePackageRegistryToken() (CreateTokenResponse, error)
CreatePackageRegistryToken uses the Gitea API to create a package registry token.
func (*Git) CreateReadOnlyUser ¶
CreateReadOnlyUser uses the Gitea API to create a non-admin Jackal user.
func (*Git) DoHTTPThings ¶
DoHTTPThings adds http request boilerplate and perform the request, checking for a successful response.
func (*Git) DownloadRepoToTemp ¶
DownloadRepoToTemp clones or updates a repo into a temp folder to perform ephemeral actions (i.e. process chart repos).
func (*Git) PushRepo ¶
PushRepo pushes a git repository from the local path to the configured git server.
func (*Git) UpdateGitUser ¶
UpdateGitUser updates Jackal git server users
func (*Git) UpdateJackalGiteaUsers ¶
func (g *Git) UpdateJackalGiteaUsers(oldState *types.JackalState) error
UpdateJackalGiteaUsers updates Jackal gitea users