github.com/jfrog/jfrog-cli-core/v2@v2.52.0/general/cisetup/cisetup.go (about)

     1  package cisetup
     2  
     3  import (
     4  	"strings"
     5  
     6  	"github.com/jfrog/jfrog-cli-core/v2/utils/coreutils"
     7  )
     8  
     9  const ConfigServerId = "jfrog-instance"
    10  
    11  type CiSetupData struct {
    12  	RepositoryName string
    13  	ProjectDomain  string
    14  	VcsBaseUrl     string
    15  	LocalDirPath   string
    16  	GitBranch      string
    17  	BuildName      string
    18  	CiType         CiType
    19  	// A collection of the technologies that were detected in the project.
    20  	DetectedTechnologies map[coreutils.Technology]bool
    21  	// The chosen build technology stored with all the necessary information.
    22  	BuiltTechnology *TechnologyInfo
    23  	VcsCredentials  VcsServerDetails
    24  	GitProvider     GitProvider
    25  }
    26  
    27  type TechnologyInfo struct {
    28  	Type               coreutils.Technology
    29  	VirtualRepo        string
    30  	LocalSnapshotsRepo string
    31  	LocalReleasesRepo  string
    32  	BuildCmd           string
    33  }
    34  
    35  func (sd *CiSetupData) GetRepoFullName() string {
    36  	return sd.ProjectDomain + "/" + sd.RepositoryName
    37  }
    38  
    39  // Trim technology name from command prefix. (example: mvn clean install >> clean install)
    40  func (sd *CiSetupData) GetBuildCmdForNativeStep() string {
    41  	// Remove exec name.
    42  	return strings.TrimPrefix(strings.TrimSpace(sd.BuiltTechnology.BuildCmd), sd.BuiltTechnology.Type.GetExecCommandName()+" ")
    43  }
    44  
    45  type VcsServerDetails struct {
    46  	Url         string `json:"url,omitempty"`
    47  	User        string `json:"user,omitempty"`
    48  	Password    string `json:"-"`
    49  	AccessToken string `json:"-"`
    50  }
    51  
    52  type GitProvider string
    53  
    54  const (
    55  	Github           = "GitHub"
    56  	GithubEnterprise = "GitHub Enterprise"
    57  	Bitbucket        = "Bitbucket"
    58  	BitbucketServer  = "Bitbucket Server"
    59  	Gitlab           = "GitLab"
    60  )
    61  
    62  type CiType string
    63  
    64  const (
    65  	Jenkins       = "Jenkins"
    66  	GithubActions = "GitHub Actions"
    67  	Pipelines     = "JFrog Pipelines"
    68  )