importcmd

package
v2.1.155 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdImport

func NewCmdImport(commonOpts *opts.CommonOptions) *cobra.Command

NewCmdImport the cobra command for jx import

Types

type CallbackFn

type CallbackFn func() error

CallbackFn callback function

type ImportOptions

type ImportOptions struct {
	*opts.CommonOptions

	RepoURL string

	Dir                     string
	Organisation            string
	Repository              string
	Credentials             string
	AppName                 string
	GitHub                  bool
	DryRun                  bool
	SelectAll               bool
	DisableDraft            bool
	DisableJenkinsfileCheck bool
	DisableWebhooks         bool
	SelectFilter            string
	Jenkinsfile             string
	BranchPattern           string
	GitRepositoryOptions    gits.GitRepositoryOptions
	ImportGitCommitMessage  string
	ListDraftPacks          bool
	DraftPack               string
	DockerRegistryOrg       string
	GitDetails              gits.CreateRepoData
	DeployKind              string
	DeployOptions           v1.DeployOptions
	SchedulerName           string

	DisableDotGitSearch   bool
	InitialisedGit        bool
	Jenkins               gojenkins.JenkinsClient
	GitConfDir            string
	GitServer             *auth.AuthServer
	GitUserAuth           *auth.UserAuth
	GitProvider           gits.GitProvider
	PostDraftPackCallback CallbackFn
	DisableMaven          bool
	PipelineUserName      string
	PipelineServer        string
	ImportMode            string
	UseDefaultGit         bool
	GithubAppInstalled    bool
	PreviewNamespace      string
	// contains filtered or unexported fields
}

ImportOptions options struct for jx import

func NewCmdImportAndOptions

func NewCmdImportAndOptions(commonOpts *opts.CommonOptions) (*cobra.Command, *ImportOptions)

NewCmdImportAndOptions creates the cobra command for jx import and the options

func (*ImportOptions) AddBotAsCollaborator added in v2.1.72

func (options *ImportOptions) AddBotAsCollaborator() error

AddBotAsCollaborator adds the pipeline bot as collaborator to the repository

func (*ImportOptions) AddImportFlags

func (options *ImportOptions) AddImportFlags(cmd *cobra.Command, createProject bool)

func (*ImportOptions) CloneRepository

func (options *ImportOptions) CloneRepository() error

CloneRepository clones a repository

func (*ImportOptions) ConfigureImportOptions

func (options *ImportOptions) ConfigureImportOptions(repoData *gits.CreateRepoData)

ConfigureImportOptions updates the import options struct based on values from the create repo struct

func (*ImportOptions) CreateNewRemoteRepository

func (options *ImportOptions) CreateNewRemoteRepository() error

CreateNewRemoteRepository creates a new remote repository

func (*ImportOptions) CreateProwOwnersAliasesFile

func (options *ImportOptions) CreateProwOwnersAliasesFile() error

CreateProwOwnersAliasesFile creates an OWNERS_ALIASES file in the root of the project assigning the current Git user as an approver and a reviewer.

func (*ImportOptions) CreateProwOwnersFile

func (options *ImportOptions) CreateProwOwnersFile() error

CreateProwOwnersFile creates an OWNERS file in the root of the project assigning the current Git user as an approver and a reviewer. If the file already exists, does nothing.

func (*ImportOptions) DefaultGitIgnore

func (options *ImportOptions) DefaultGitIgnore() error

DefaultGitIgnore creates a default .gitignore

func (*ImportOptions) DefaultValuesFromTeamSettings

func (options *ImportOptions) DefaultValuesFromTeamSettings(settings *v1.TeamSettings) error

DefaultValuesFromTeamSettings defaults the repository options from the given team settings

func (*ImportOptions) DefaultsFromTeamSettings

func (options *ImportOptions) DefaultsFromTeamSettings() error

func (*ImportOptions) DiscoverGit

func (options *ImportOptions) DiscoverGit() error

DiscoverGit checks if there is a git clone or prompts the user to import it

func (*ImportOptions) DiscoverRemoteGitURL

func (options *ImportOptions) DiscoverRemoteGitURL() error

DiscoverRemoteGitURL finds the git url by looking in the directory and looking for a .git/config file

func (*ImportOptions) DraftCreate

func (options *ImportOptions) DraftCreate() error

DraftCreate creates a draft

func (*ImportOptions) GetGitRepositoryDetails

func (options *ImportOptions) GetGitRepositoryDetails() (*gits.CreateRepoData, error)

GetGitRepositoryDetails determines the git repository details to use during the import command

func (*ImportOptions) GetOrganisation

func (options *ImportOptions) GetOrganisation() string

GetOrganisation gets the organisation from the RepoURL (if in the github format of github.com/org/repo). It will do this in preference to the Organisation field (if set). If the repo URL does not implicitly specify an organisation then the Organisation specified in the options is used.

func (*ImportOptions) GetReporter

func (options *ImportOptions) GetReporter() ImportReporter

GetReporter returns the reporter interface

func (*ImportOptions) ImportProjectsFromGitHub

func (options *ImportOptions) ImportProjectsFromGitHub() error

ImportProjectsFromGitHub import projects from github

func (*ImportOptions) ReplacePlaceholders

func (options *ImportOptions) ReplacePlaceholders(gitServerName, dockerRegistryOrg string) error

ReplacePlaceholders replaces app name, git server name, git org, and docker registry org placeholders

func (*ImportOptions) Run

func (options *ImportOptions) Run() error

Run executes the command

func (*ImportOptions) SetReporter

func (options *ImportOptions) SetReporter(reporter ImportReporter)

SetReporter overrides the reporter interface

type ImportReporter

type ImportReporter interface {
	// UsingGitUserName report progress
	UsingGitUserName(username string)
	// ClonedGitRepository report progress
	ClonedGitRepository(url string)
	// PushedGitRepository report progress
	PushedGitRepository(url string)
	// GitRepositoryCreated report progress
	GitRepositoryCreated()
	// CreatedDevRepoPullRequest report progress
	CreatedDevRepoPullRequest(prURL string, devGitURL string)
	// CreatedProject report progress
	CreatedProject(genDir string)
	// GeneratedQuickStartAt report progress
	GeneratedQuickStartAt(genDir string)
	// DraftCreated report progress
	DraftCreated(draftPack string)
	// Trace report generic trace message
	Trace(message string, options ...interface{})
}

ImportReporter an interface for reporting updates from the process

type LogImportReporter

type LogImportReporter struct {
}

LogImportReporter default implementation to log to the console

func (*LogImportReporter) ClonedGitRepository

func (r *LogImportReporter) ClonedGitRepository(repoURL string)

ClonedGitRepository report progress

func (*LogImportReporter) CreatedDevRepoPullRequest

func (r *LogImportReporter) CreatedDevRepoPullRequest(prURL string, devGitURL string)

CreatedDevRepoPullRequest report progress

func (*LogImportReporter) CreatedProject

func (r *LogImportReporter) CreatedProject(genDir string)

CreatedProject report progress

func (*LogImportReporter) DraftCreated

func (r *LogImportReporter) DraftCreated(draftPack string)

DraftCreated report progress

func (*LogImportReporter) GeneratedQuickStartAt

func (r *LogImportReporter) GeneratedQuickStartAt(genDir string)

GeneratedQuickStartAt report progress

func (*LogImportReporter) GitRepositoryCreated

func (r *LogImportReporter) GitRepositoryCreated()

GitRepositoryCreated report progress

func (*LogImportReporter) PushedGitRepository

func (r *LogImportReporter) PushedGitRepository(repoURL string)

PushedGitRepository report progress

func (*LogImportReporter) Trace

func (r *LogImportReporter) Trace(message string, args ...interface{})

Trace report generic trace message

func (*LogImportReporter) UsingGitUserName

func (r *LogImportReporter) UsingGitUserName(username string)

UsingGitUserName report progress

Directories

Path Synopsis
test_data

Jump to

Keyboard shortcuts

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