gitlab

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllGroupMembers

func AllGroupMembers(cmd common.ConfiguredCommand, c *gl.Client, gID int) []*gl.GroupMember

returns the list of all gitlab project members for the given gitlab group ID.

func AllGroups

func AllGroups(cmd common.ConfiguredCommand, c *gl.Client) []*gl.Group

returns the list of all visible (per auth token) gitlab groups.

func AllLabels

func AllLabels(cmd common.ConfiguredCommand, c *gl.Client, pID int) []*gl.Label

returns the list of all gitlab project labels for the given project ID.

func AllProjectTags

func AllProjectTags(cmd common.ConfiguredCommand, c *gl.Client, pID int) []*gl.Tag

returns the list of all tags for the given gitlab project ID.

func AllProjects

func AllProjects(cmd common.ConfiguredCommand, c *gl.Client, gID int) []*gl.Project

returns the list of all gitlab projects for the given gitlab group ID.

func AllUserProjects added in v0.5.0

func AllUserProjects(cmd common.ConfiguredCommand, c *gl.Client, uID int) []*gl.Project

returns the list of all personal gitlab projects for the given user ID.

func CurrentInstance added in v0.6.0

func CurrentInstance(cmd common.ConfiguredCommand, creds *common.GitlabCredentials) (string, error)

returns the current instance name if configured.

func CurrentUser added in v0.6.0

func CurrentUser(cmd common.ConfiguredCommand, creds *common.GitlabCredentials) (*gl.User, error)

returns the current gitlab user if configured.

func EnsureRepoPath added in v0.6.0

func EnsureRepoPath(cmd common.ConfiguredCommand, creds *common.GitlabCredentials, usr *gl.User, grp *gl.Group, prj *gl.Project) string

for the given configuration and project by user in group returns the local path to the clone, which is: $LOCAL_BASEDIR/.config/mkactl/repo/${address_from_current_context_urlencoded}/${user_id}/${group_id_or_0}/${project_path}

the address value in the config context of the provided command must not be nil the provided group may be nil for personal projects usr.ID and prj.Path must not be nil.

func FindGroup

func FindGroup(groups []*gl.Group, id int) *gl.Group

for the given collection of gitlab groups finds the one with the given group id and returns it.

func FindProject added in v0.4.0

func FindProject(prs Projects, name string) *gl.Project

for the given collection of gitlab projects finds the one with the given name and returns it.

func GroupMaintainer

func GroupMaintainer(cmd common.ConfiguredCommand, c *gl.Client, g *gl.Group, u *gl.User) bool

verifies the given gitlab user is a member of the given gitlab group and has at least maintainer permissions there.

func LatestTag

func LatestTag(cmd common.ConfiguredCommand, c *gl.Client, p *gl.Project) string

for the given gitlab project returns the latest (updated) tag.

func NewClient

func NewClient(cmd common.ConfiguredCommand, creds *common.GitlabCredentials) *gl.Client

constructs a new gitlab client using the given credentials missing credentials will be taken from the current configurationq.

func ParseCIFile

func ParseCIFile(path string) (ci map[string]interface{})

attempts to read the gitlab CI file at the given path and returns an unmarshalled map of maps for it.

func SelectConfigRepo added in v0.6.0

func SelectConfigRepo(cmd common.ConfiguredCommand, r *common.RepoInfo)

sets the given string as the selected repository in the configuration and writes the configuration to the currently used config file.

func SelectedConfigRepo added in v0.6.0

func SelectedConfigRepo(cmd common.ConfiguredCommand, creds *common.GitlabCredentials) (*common.RepoInfo, error)

returns the currently selected repository from the current configuration.

func UncheckForwardDeployment

func UncheckForwardDeployment(c *gl.Client, p *gl.Project) *gl.Project

for the given gitlab project sets the 'CI Forward Deployment' setting to false returns the gitlab project for chaining.

func WriteBaseCIFile

func WriteBaseCIFile(basePath string, refs *common.BlockRefs) string

writes the gitlab CI file at the given parent path using the given collection of building blocks. returns $basePath/$filename.

Types

type Projects

type Projects []*gl.Project

a collection of gitlab projects.

func AllBuildingBlocks

func AllBuildingBlocks(cmd common.ConfiguredCommand, creds *common.GitlabCredentials) Projects

returns all existing building block gitlab projects for the given credentials object.

func (*Projects) MaxNameLen

func (ps *Projects) MaxNameLen() int

for this gitlab project collection returns the length of the longest name contained NB: "project name" actually always refers to gitlab.Project.Path.

Jump to

Keyboard shortcuts

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