Documentation
¶
Index ¶
- Variables
- func BuildCheckLoop(ctx *command.Context, buildID string) error
- func CustomMigrateLint(ctx *command.Context, input, config string, noDetail bool, output string) (err error)
- func PrintWorkFlow(ctx *command.Context, buildID string) error
- func RmSandbox(name string) error
- func RunBuild(ctx *command.Context, repo, branch, filename, alias string) (err error)
- func RunCheck(ctx *command.Context, ymlPath string) error
- func RunExtensions(ctx *command.Context, all bool) error
- func RunExtensionsPull(ctx *command.Context, extension string, dir string) error
- func RunExtensionsPush(ctx *command.Context, force bool, all bool, dir, registry string) error
- func RunExtensionsReTag(ctx *command.Context, dir string, registry string, output string) error
- func RunInit(ctx *Context) error
- func RunMigrate(ctx *command.Context, host string, port int, ...) error
- func RunMigrateLint(ctx *command.Context, input, config string, noDetail bool, output string, ...) (err error)
- func RunMigrateMkPy(ctx *command.Context, workdir, module, name string, tables []string) error
- func RunMigrateMkPyPkg(ctx *command.Context, host string, port int, ...) (err error)
- func RunMigrateRecord(ctx *command.Context, host string, port int, ...) error
- func RunParse(ctx *Context, ymlPath string, ymlContent string, ...) error
- func RunPipelineStatus(ctx *command.Context, branch string, pipelineID int) error
- func RunVersion(ctx *Context) error
- func RunViewPipe(ctx *command.Context, repo, branch string, pipelineID int, watch bool) (err error)
- func StandardMigrateLint(ctx *command.Context, input, config string) (err error)
- func StartSandbox(exposePort int, name string) error
- func StopSandbox(name string) error
- type DockerAuth
- type DockerConfig
- type ExtensionInfo
Constants ¶
This section is empty.
Variables ¶
View Source
var BUILD = command.Command{ Name: "build", ShortHelp: "Create an pipeline and run it", Example: `$ erda-cli build`, Flags: []command.Flag{ command.StringFlag{ Short: "r", Name: "repo", Doc: "the repo on Erda DOP", DefaultValue: os.Getenv("ERDA_REPO"), }, command.StringFlag{Short: "b", Name: "branch", Doc: "branch to create pipeline, default is current branch", DefaultValue: ""}, command.StringFlag{ Short: "f", Name: "pipeline-file", Doc: "The specified local pipeline file", DefaultValue: "", }, command.StringFlag{ Short: "", Name: "alias", Doc: "pipeline task alias name", DefaultValue: "", }, }, Run: RunBuild, }
BUILD command
View Source
var CHECK = command.Command{ Name: "check", ShortHelp: "Validate dice.yml file", Example: ` $ dice check -f dice.yml `, Flags: []command.Flag{ command.StringFlag{Short: "f", Name: "file", Doc: "Specify the path of dice.yml file, default: .dice/dice.yml", DefaultValue: ""}, }, Run: RunCheck, Hidden: true, }
CHECK command
View Source
var EXT = command.Command{ Name: "ext", ShortHelp: "Extensions operation sets,including search, pull, push, retag", Example: `dice ext`, Flags: []command.Flag{ command.BoolFlag{Short: "a", Name: "all", Doc: "query all extensions", DefaultValue: false}, }, Run: RunExtensions, }
View Source
var EXTENSIONSPULL = command.Command{ Name: "pull", ParentName: "EXT", ShortHelp: "pull extension", Example: ` $ dice ext pull git-checkout@1.0 -o git-checkout `, Args: []command.Arg{ command.StringArg{}.Name("extension"), }, Flags: []command.Flag{ command.StringFlag{Short: "o", Name: "output", Doc: "which directory to export to", DefaultValue: ""}, }, Run: RunExtensionsPull, }
View Source
var EXTENSIONSPUSH = command.Command{ Name: "push", ParentName: "EXT", ShortHelp: "push extension", Example: ` $ dice ext push -f --public `, Flags: []command.Flag{ command.BoolFlag{Short: "f", Name: "force", Doc: "override exist version", DefaultValue: false}, command.BoolFlag{Short: "a", Name: "all", Doc: "override exist extension and version,must with -f", DefaultValue: false}, command.StringFlag{Short: "d", Name: "dir", Doc: "extension dir", DefaultValue: ""}, command.StringFlag{Short: "r", Name: "registry", Doc: "new registry", DefaultValue: ""}, }, Run: RunExtensionsPush, }
View Source
var EXTENSIONSRETAG = command.Command{ Name: "retag", ParentName: "EXT", ShortHelp: "generate retag script", Example: ` $ dice ext retag -d extensions -r registry.default.svc.cluster.local:5000 -o retag.sh `, Flags: []command.Flag{ command.StringFlag{Short: "d", Name: "dir", Doc: "extension dir", DefaultValue: "."}, command.StringFlag{Short: "r", Name: "registry", Doc: "new registry", DefaultValue: "registry.default.svc.cluster.local:5000"}, command.StringFlag{Short: "o", Name: "output", Doc: "output script file", DefaultValue: "retag.sh"}, }, Run: RunExtensionsReTag, }
View Source
var INIT = Command{ Name: "init", ShortHelp: "Init a dice.yml template", LongHelp: "Make a .dice dir in current directory, then create a dice.yml template", Example: ` $ dice init `, Run: RunInit, Hidden: true, }
View Source
var Migrate = command.Command{ ParentName: "", Name: "migrate", ShortHelp: "Erda MySQL Migrate", LongHelp: "erda-cli migrate --mysql-host localhost --mysql-username root --mysql-password my_password --database erda", Example: "erda-cli migrate --mysql-host localhost --mysql-username root --mysql-password my_password --database erda", Hidden: false, DontHideCursor: false, Args: nil, Flags: append(mysqlFlags, command.StringFlag{ Short: "", Name: "lint-config", Doc: "[Lint] Erda MySQL Lint config file", DefaultValue: "", }, command.StringListFlag{ Short: "", Name: "modules", Doc: "[Lint] the modules for migrating", DefaultValue: nil, }, command.BoolFlag{ Short: "", Name: "debug-sql", Doc: "[Migrate] print SQLs", DefaultValue: false, }, command.BoolFlag{ Short: "", Name: "skip-lint", Doc: "[Lint] don't do Erda MySQL Lint", DefaultValue: false, }, command.BoolFlag{ Short: "", Name: "skip-sandbox", Doc: "[Migrate] skip doing migration in sandbox", DefaultValue: false, }, command.BoolFlag{ Short: "", Name: "skip-pre-mig", Doc: "[Migrate] skip doing pre-migration", DefaultValue: false, }, command.BoolFlag{ Short: "", Name: "skip-mig", Doc: "[Migrate] skip doing pre-migration and real migration", DefaultValue: false, }, command.StringFlag{ Short: "", Name: "output", Doc: "[Migrate] the directory for collecting SQLs", DefaultValue: "", }, ), Run: RunMigrate, }
View Source
var MigrateMkPyPkg = command.Command{ ParentName: "Migrate", Name: "mkpypkg", ShortHelp: "generate python package", LongHelp: "generate python package", Example: "erda-cli migrate mkpypkg --filename=my_script.py --mysql-host localhost --mysql-port 3306 --mysql-username root --mysql-password *** --database erda --sandbox-port 3307", Hidden: true, DontHideCursor: false, Args: nil, Flags: append( mysqlFlags, command.StringFlag{ Short: "", Name: "filename", Doc: "python script filename", DefaultValue: "", }, command.StringFlag{ Short: "", Name: "requirements", Doc: "requirements.txt file name", DefaultValue: "", }, command.BoolFlag{ Short: "", Name: "commit", Doc: "", DefaultValue: false, }, ), Run: RunMigrateMkPyPkg, }
View Source
var MigratePy = command.Command{ ParentName: "Migrate", Name: "mkpy", ShortHelp: "make a python migration script pattern", LongHelp: "make a python migration scritp pattern.", Example: "erda-cli migrate mkpy --module my_module --name my_script_name", Hidden: false, DontHideCursor: false, Args: nil, Flags: []command.Flag{ command.StringFlag{ Short: "", Name: "workdir", Doc: "workdir", DefaultValue: ".", }, command.StringFlag{ Short: "m", Name: "module", Doc: "migration module name", DefaultValue: "", }, command.StringFlag{ Short: "n", Name: "name", Doc: "script name", DefaultValue: "", }, command.StringListFlag{ Short: "", Name: "tables", Doc: "dependency tables", DefaultValue: nil, }, }, Run: RunMigrateMkPy, }
View Source
var MigrateRecord = command.Command{ ParentName: "Migrate", Name: "record", ShortHelp: "manually insert the migration record", LongHelp: "manually isnert the migration record", Example: "erda-cli migrate record --filename a.sql", Hidden: false, DontHideCursor: false, Args: nil, Flags: append(mysqlFlags, command.StringFlag{ Short: "", Name: "module", Doc: "the recording script module name", DefaultValue: "", }, command.StringFlag{ Short: "", Name: "filename", Doc: "the recording script filename", DefaultValue: "", }, command.BoolFlag{ Short: "", Name: "dry", Doc: "dry run", DefaultValue: false, }, ), Run: RunMigrateRecord, }
View Source
var MigrationLint = command.Command{ ParentName: "Migrate", Name: "lint", ShortHelp: "Erda MySQL Migration lint", LongHelp: "Erda MySQL Migration lint", Example: "erda-cli migrate lint --input=. --config=default.yaml --detail", Hidden: false, DontHideCursor: false, Args: nil, Flags: []command.Flag{ command.StringFlag{ Short: "", Name: "input", Doc: "[optional] the file or directory for linting", DefaultValue: ".", }, command.StringFlag{ Short: "", Name: "lint-config", Doc: "[optional] the lint config file", DefaultValue: "", }, command.BoolFlag{ Short: "", Name: "no-detail", Doc: "[optional] do not print details of lint result", DefaultValue: false, }, command.StringFlag{ Short: "o", Name: "output", Doc: "[optional] result output file name", DefaultValue: "", }, command.BoolFlag{ Short: "", Name: "custom", Doc: "custom directory", DefaultValue: false, }, }, Run: RunMigrateLint, }
View Source
var PARSE = Command{ Name: "parse", ShortHelp: "Parse the dice.yml file", Flags: []Flag{ StringFlag{"f", "file", "Specify the path of dice.yml file, default: .dice/dice.yml", ""}, StringFlag{"s", "str", "Provide the content of dice.yml file as a string", ""}, BoolFlag{"", "dev", "Parse the dice.yml file in development environment ", false}, BoolFlag{"", "test", "Parse the dice.yml file in test environment", false}, BoolFlag{"", "staging", "Parse the dice.yml file in staging environment", false}, BoolFlag{"", "prod", "Parse the dice.yml in production environment", false}, BoolFlag{"o", "output", "Output the content as yaml", false}, }, Run: RunParse, Hidden: true, }
View Source
var STATUS = command.Command{ Name: "status", ShortHelp: "Show build status", Example: ` $ erda-cli status -b develop `, Flags: []command.Flag{ command.StringFlag{Short: "b", Name: "branch", Doc: "specify branch to show pipeline status, default is current branch", DefaultValue: ""}, command.IntFlag{Short: "i", Name: "pipelineID", Doc: "specify pipeline id to show pipeline status", DefaultValue: 0}, }, Run: RunPipelineStatus, }
View Source
var VERSION = Command{ Name: "version", ShortHelp: "Show dice version info", Example: `$ dice version`, Run: RunVersion, }
View Source
var VIEW = command.Command{ Name: "view", ShortHelp: "View build status", Example: ` $ erda-cli view -b develop -i <pipelineID> --host https://openapi.erda.cloud `, Flags: []command.Flag{ command.StringFlag{ Short: "r", Name: "repo", Doc: "the repo on Erda DOP, default current repo.", DefaultValue: os.Getenv("ERDA_REPO"), }, command.StringFlag{Short: "b", Name: "branch", Doc: "specify branch to show pipeline status, default is current branch", DefaultValue: ""}, command.IntFlag{Short: "i", Name: "pipelineID", Doc: "specify pipeline id to show pipeline status", DefaultValue: 0}, command.BoolFlag{ Short: "w", Name: "watch", Doc: "watch the status", DefaultValue: false, }, }, Run: RunViewPipe, }
Functions ¶
func BuildCheckLoop ¶
BuildCheckLoop checks build status in a loop while interactive is true
func CustomMigrateLint ¶ added in v1.1.0
func PrintWorkFlow ¶
PrintWorkFlow prints build work flow in diagram format
func RunExtensionsPull ¶
func RunExtensionsPush ¶
func RunExtensionsReTag ¶
func RunMigrate ¶ added in v1.1.0
func RunMigrateLint ¶ added in v1.1.0
func RunMigrateMkPy ¶ added in v1.1.0
func RunMigrateMkPyPkg ¶ added in v1.1.0
func RunMigrateRecord ¶ added in v1.1.0
func RunPipelineStatus ¶
RunBuildsInspect displays detailed information on the build record
func RunVersion ¶
func RunVersion(ctx *Context) error
func RunViewPipe ¶ added in v1.5.0
RunViewPipe displays detailed information on the build record
func StandardMigrateLint ¶ added in v1.1.0
func StartSandbox ¶ added in v1.1.0
func StopSandbox ¶ added in v1.1.0
Types ¶
type DockerAuth ¶
type DockerAuth struct {
Auth string `json:"auth"`
}
type DockerConfig ¶
type DockerConfig struct {
Auths map[string]DockerAuth `json:"auths"`
}
type ExtensionInfo ¶
type ExtensionInfo struct { Path string Spec apistructs.Spec Dice map[string]interface{} DiceErr error SpecErr error }
func GetExtMetas ¶
func GetExtMetas(dir string) []ExtensionInfo
Click to show internal directories.
Click to hide internal directories.