jx: github.com/jenkins-x/jx/pkg/cmd/importcmd Index | Files

package importcmd

import "github.com/jenkins-x/jx/pkg/cmd/importcmd"

Index

Package Files

import.go import_reporter.go

func NewCmdImport Uses

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

NewCmdImport the cobra command for jx import

type CallbackFn Uses

type CallbackFn func() error

CallbackFn callback function

type ImportOptions Uses

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
    // contains filtered or unexported fields
}

ImportOptions options struct for jx import

func NewCmdImportAndOptions Uses

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

NewCmdImportAndOptions creates the cobra command for jx import and the options

func (*ImportOptions) AddImportFlags Uses

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

func (*ImportOptions) CloneRepository Uses

func (options *ImportOptions) CloneRepository() error

CloneRepository clones a repository

func (*ImportOptions) ConfigureImportOptions Uses

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

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

func (*ImportOptions) CreateNewRemoteRepository Uses

func (options *ImportOptions) CreateNewRemoteRepository() error

CreateNewRemoteRepository creates a new remote repository

func (*ImportOptions) CreateProwOwnersAliasesFile Uses

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 Uses

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 Uses

func (options *ImportOptions) DefaultGitIgnore() error

DefaultGitIgnore creates a default .gitignore

func (*ImportOptions) DefaultValuesFromTeamSettings Uses

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

DefaultValuesFromTeamSettings defaults the repository options from the given team settings

func (*ImportOptions) DefaultsFromTeamSettings Uses

func (options *ImportOptions) DefaultsFromTeamSettings() error

func (*ImportOptions) DiscoverGit Uses

func (options *ImportOptions) DiscoverGit() error

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

func (*ImportOptions) DiscoverRemoteGitURL Uses

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 Uses

func (options *ImportOptions) DraftCreate() error

DraftCreate creates a draft

func (*ImportOptions) GetGitRepositoryDetails Uses

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

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

func (*ImportOptions) GetOrganisation Uses

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 Uses

func (options *ImportOptions) GetReporter() ImportReporter

GetReporter returns the reporter interface

func (*ImportOptions) ImportProjectsFromGitHub Uses

func (options *ImportOptions) ImportProjectsFromGitHub() error

ImportProjectsFromGitHub import projects from github

func (*ImportOptions) ReplacePlaceholders Uses

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 Uses

func (options *ImportOptions) Run() error

Run executes the command

func (*ImportOptions) SetReporter Uses

func (options *ImportOptions) SetReporter(reporter ImportReporter)

SetReporter overrides the reporter interface

type ImportReporter Uses

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 Uses

type LogImportReporter struct {
}

LogImportReporter default implementation to log to the console

func (*LogImportReporter) ClonedGitRepository Uses

func (r *LogImportReporter) ClonedGitRepository(repoURL string)

ClonedGitRepository report progress

func (*LogImportReporter) CreatedDevRepoPullRequest Uses

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

CreatedDevRepoPullRequest report progress

func (*LogImportReporter) CreatedProject Uses

func (r *LogImportReporter) CreatedProject(genDir string)

CreatedProject report progress

func (*LogImportReporter) DraftCreated Uses

func (r *LogImportReporter) DraftCreated(draftPack string)

DraftCreated report progress

func (*LogImportReporter) GeneratedQuickStartAt Uses

func (r *LogImportReporter) GeneratedQuickStartAt(genDir string)

GeneratedQuickStartAt report progress

func (*LogImportReporter) GitRepositoryCreated Uses

func (r *LogImportReporter) GitRepositoryCreated()

GitRepositoryCreated report progress

func (*LogImportReporter) PushedGitRepository Uses

func (r *LogImportReporter) PushedGitRepository(repoURL string)

PushedGitRepository report progress

func (*LogImportReporter) Trace Uses

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

Trace report generic trace message

func (*LogImportReporter) UsingGitUserName Uses

func (r *LogImportReporter) UsingGitUserName(username string)

UsingGitUserName report progress

Package importcmd imports 36 packages (graph) and is imported by 1 packages. Updated 2020-06-03. Refresh now. Tools for package owners.