log

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package log provides the defined log CLI commands for Vela.

Usage:

import "github.com/go-vela/cli/command/log"

Index

Constants

This section is empty.

Variables

View Source
var CommandGet = &cli.Command{
	Name:        "log",
	Aliases:     []string{"logs"},
	Description: "Use this command to get a list of build logs.",
	Usage:       "Display a list of build logs",
	Action:      get,
	Flags: []cli.Flag{

		&cli.StringFlag{
			EnvVars: []string{"VELA_ORG", "LOG_ORG"},
			Name:    internal.FlagOrg,
			Aliases: []string{"o"},
			Usage:   "provide the organization for the log",
		},
		&cli.StringFlag{
			EnvVars: []string{"VELA_REPO", "LOG_REPO"},
			Name:    internal.FlagRepo,
			Aliases: []string{"r"},
			Usage:   "provide the repository for the log",
		},

		&cli.IntFlag{
			EnvVars: []string{"VELA_BUILD", "LOG_BUILD"},
			Name:    internal.FlagBuild,
			Aliases: []string{"b"},
			Usage:   "provide the build for the log",
		},

		&cli.StringFlag{
			EnvVars: []string{"VELA_OUTPUT", "LOG_OUTPUT"},
			Name:    internal.FlagOutput,
			Aliases: []string{"op"},
			Usage:   "format the output in json, spew or yaml",
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
  1. Get logs for a build.
    $ {{.HelpName}} --org MyOrg --repo MyRepo --build 1
  2. Get logs for a build with yaml output.
    $ {{.HelpName}} --org MyOrg --repo MyRepo --build 1 --output yaml
  3. Get logs for a build with json output.
    $ {{.HelpName}} --org MyOrg --repo MyRepo --build 1 --output json
  4. Get logs for a build when config or environment variables are set.
    $ {{.HelpName}} --build 1

DOCUMENTATION:

  https://go-vela.github.io/docs/reference/cli/log/get/
`, cli.CommandHelpTemplate),
}

CommandGet defines the command for capturing a list of build logs.

View Source
var CommandView = &cli.Command{
	Name:        "log",
	Description: "Use this command to view a log.",
	Usage:       "View details of the provided log",
	Action:      view,
	Flags: []cli.Flag{

		&cli.StringFlag{
			EnvVars: []string{"VELA_ORG", "LOG_ORG"},
			Name:    internal.FlagOrg,
			Aliases: []string{"o"},
			Usage:   "provide the organization for the log",
		},
		&cli.StringFlag{
			EnvVars: []string{"VELA_REPO", "LOG_REPO"},
			Name:    internal.FlagRepo,
			Aliases: []string{"r"},
			Usage:   "provide the repository for the log",
		},

		&cli.IntFlag{
			EnvVars: []string{"VELA_BUILD", "LOG_BUILD"},
			Name:    internal.FlagBuild,
			Aliases: []string{"b"},
			Usage:   "provide the build for the log",
		},

		&cli.IntFlag{
			EnvVars: []string{"VELA_SERVICE", "LOG_SERVICE"},
			Name:    internal.FlagService,
			Usage:   "provide the service for the log",
		},

		&cli.IntFlag{
			EnvVars: []string{"VELA_STEP", "LOG_STEP"},
			Name:    internal.FlagStep,
			Usage:   "provide the step for the log",
		},

		&cli.StringFlag{
			EnvVars: []string{"VELA_OUTPUT", "LOG_OUTPUT"},
			Name:    internal.FlagOutput,
			Aliases: []string{"op"},
			Usage:   "format the output in json, spew or yaml",
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
  1. View logs for a build.
    $ {{.HelpName}} --org MyOrg --repo MyRepo --build 1
  2. View logs for a service.
    $ {{.HelpName}} --org MyOrg --repo MyRepo --build 1 --service 1
  3. View logs for a step.
    $ {{.HelpName}} --org MyOrg --repo MyRepo --build 1 --step 1
  4. View logs for a build with yaml output.
    $ {{.HelpName}} --org MyOrg --repo MyRepo --build 1 --output yaml
  5. View logs for a build with json output.
    $ {{.HelpName}} --org MyOrg --repo MyRepo --build 1 --output json
  6. View logs for a build when config or environment variables are set.
    $ {{.HelpName}} --build 1

DOCUMENTATION:

  https://go-vela.github.io/docs/reference/cli/log/view/
`, cli.CommandHelpTemplate),
}

CommandView defines the command for inspecting a log.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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