Help us shape the future of Go! Take the 2026 Go Developer Survey

service

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package service provides the defined service CLI commands for Vela.

Usage:

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

Index

Constants

This section is empty.

Variables

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

		&cli.StringFlag{
			Sources: cli.EnvVars("VELA_ORG", "SERVICE_ORG"),
			Name:    internal.FlagOrg,
			Aliases: []string{"o"},
			Usage:   "provide the organization for the build",
		},
		&cli.StringFlag{
			Sources: cli.EnvVars("VELA_REPO", "SERVICE_REPO"),
			Name:    internal.FlagRepo,
			Aliases: []string{"r"},
			Usage:   "provide the repository for the build",
		},

		&cli.Int64Flag{
			Sources: cli.EnvVars("VELA_BUILD", "SERVICE_BUILD"),
			Name:    internal.FlagBuild,
			Aliases: []string{"b"},
			Usage:   "provide the build for the service",
		},

		&cli.StringFlag{
			Sources: cli.EnvVars("VELA_OUTPUT", "SERVICE_OUTPUT"),
			Name:    internal.FlagOutput,
			Aliases: []string{"op"},
			Usage:   "format the output in json, spew, wide or yaml",
		},

		&cli.IntFlag{
			Sources: cli.EnvVars("VELA_PAGE", "SERVICE_PAGE"),
			Name:    internal.FlagPage,
			Aliases: []string{"p"},
			Usage:   "print a specific page of services",
			Value:   1,
		},
		&cli.IntFlag{
			Sources: cli.EnvVars("VELA_PER_PAGE", "SERVICE_PER_PAGE"),
			Name:    internal.FlagPerPage,
			Aliases: []string{"pp"},
			Usage:   "number of services to print per page",
			Value:   10,
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
  1. Get services for a repository.
    $ {{.FullName}} --org MyOrg --repo MyRepo --build 1
  2. Get services for a repository with wide view output.
    $ {{.FullName}} --org MyOrg --repo MyRepo --build 1 --output wide
  3. Get services for a repository with yaml output.
    $ {{.FullName}} --org MyOrg --repo MyRepo --build 1 --output yaml
  4. Get services for a repository with json output.
    $ {{.FullName}} --org MyOrg --repo MyRepo --build 1 --output json
  5. Get services for a build when config or environment variables are set.
    $ {{.FullName}} --build 1

DOCUMENTATION:

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

CommandGet defines the command for capturing a list of services.

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

		&cli.StringFlag{
			Sources: cli.EnvVars("VELA_ORG", "SERVICE_ORG"),
			Name:    internal.FlagOrg,
			Aliases: []string{"o"},
			Usage:   "provide the organization for the service",
		},
		&cli.StringFlag{
			Sources: cli.EnvVars("VELA_REPO", "SERVICE_REPO"),
			Name:    internal.FlagRepo,
			Aliases: []string{"r"},
			Usage:   "provide the repository for the service",
		},

		&cli.Int64Flag{
			Sources: cli.EnvVars("VELA_BUILD", "SERVICE_BUILD"),
			Name:    internal.FlagBuild,
			Aliases: []string{"b"},
			Usage:   "provide the build for the service",
		},

		&cli.Int32Flag{
			Sources: cli.EnvVars("VELA_SERVICE", "SERVICE_NUMBER"),
			Name:    internal.FlagService,
			Aliases: []string{"s", "number", "sn"},
			Usage:   "provide the number for the service",
		},

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

DOCUMENTATION:

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

CommandView defines the command for inspecting a service.

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