schedule

package
v0.23.3 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package schedule provides the defined schedule CLI command for Vela.

Usage:

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

Index

Constants

This section is empty.

Variables

View Source
var CommandAdd = &cli.Command{
	Name:        "schedule",
	Description: "Use this command to add a schedule.",
	Usage:       "Add a new schedule from the provided configuration",
	Action:      add,
	Flags: []cli.Flag{

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

		&cli.StringFlag{
			EnvVars: []string{"VELA_SCHEDULE", "SCHEDULE_NAME"},
			Name:    internal.FlagSchedule,
			Aliases: []string{"s"},
			Usage:   "provide the name for the schedule",
		},
		&cli.StringFlag{
			EnvVars: []string{"VELA_ACTIVE", "SCHEDULE_ACTIVE"},
			Name:    "active",
			Aliases: []string{"a"},
			Usage:   "provided the status for the schedule",
			Value:   "true",
		},
		&cli.StringFlag{
			EnvVars: []string{"VELA_ENTRY", "SCHEDULE_ENTRY"},
			Name:    "entry",
			Aliases: []string{"e"},
			Usage:   "provide the entry for the schedule",
		},
		&cli.StringFlag{
			EnvVars: []string{"VELA_BRANCH", "SCHEDULE_BRANCH"},
			Name:    "branch",
			Aliases: []string{"b"},
			Usage:   "provide the branch for the schedule",
		},

		&cli.StringFlag{
			EnvVars: []string{"VELA_OUTPUT", "SCHEDULE_OUTPUT"},
			Name:    internal.FlagOutput,
			Aliases: []string{"op"},
			Usage:   "format the output in json, spew or yaml",
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
  1. Add a schedule to a repository with active not enabled.
    $ {{.HelpName}} --org MyOrg --repo MyRepo --schedule hourly --entry '0 * * * *' --active false
  2. Add a schedule to a repository with a nightly entry.
    $ {{.HelpName}} --org MyOrg --repo MyRepo --schedule nightly --entry '0 0 * * *'
  3. Add a schedule to a repository with a weekly entry.
    $ {{.HelpName}} --org MyOrg --repo MyRepo --schedule weekly --entry '@weekly'
  4. Add a schedule to a repository when config or environment variables are set.
    $ {{.HelpName}}

DOCUMENTATION:

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

CommandAdd defines the command for creating a schedule.

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

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

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

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

DOCUMENTATION:

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

CommandGet defines the command for capturing a list of schedules.

View Source
var CommandRemove = &cli.Command{
	Name:        "schedule",
	Description: "Use this command to remove a schedule.",
	Usage:       "Remove the provided schedule",
	Action:      remove,
	Flags: []cli.Flag{

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

		&cli.StringFlag{
			EnvVars: []string{"VELA_SCHEDULE", "SCHEDULE_NAME"},
			Name:    internal.FlagSchedule,
			Aliases: []string{"s"},
			Usage:   "provide the name for the schedule",
		},

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

DOCUMENTATION:

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

CommandRemove defines the command for removing a schedule.

View Source
var CommandUpdate = &cli.Command{
	Name:        "schedule",
	Description: "Use this command to update a schedule.",
	Usage:       "Update a schedule from the provided configuration",
	Action:      update,
	Flags: []cli.Flag{

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

		&cli.StringFlag{
			EnvVars: []string{"VELA_SCHEDULE", "SCHEDULE_NAME"},
			Name:    internal.FlagSchedule,
			Aliases: []string{"s"},
			Usage:   "provide the name for the schedule",
		},
		&cli.StringFlag{
			EnvVars: []string{"VELA_ACTIVE", "SCHEDULE_ACTIVE"},
			Name:    "active",
			Aliases: []string{"a"},
			Usage:   "provided the status for the schedule",
			Value:   "true",
		},
		&cli.StringFlag{
			EnvVars: []string{"VELA_ENTRY", "SCHEDULE_ENTRY"},
			Name:    "entry",
			Aliases: []string{"e"},
			Usage:   "provide the entry for the schedule",
		},
		&cli.StringFlag{
			EnvVars: []string{"VELA_BRANCH", "SCHEDULE_BRANCH"},
			Name:    "branch",
			Aliases: []string{"b"},
			Usage:   "provide the branch for the schedule",
		},

		&cli.StringFlag{
			EnvVars: []string{"VELA_OUTPUT", "SCHEDULE_OUTPUT"},
			Name:    internal.FlagOutput,
			Aliases: []string{"op"},
			Usage:   "format the output in json, spew or yaml",
		},
	},
	CustomHelpTemplate: fmt.Sprintf(`%s
EXAMPLES:
  1. Update a schedule for a repository with active disabled.
    $ {{.HelpName}} --org MyOrg --repo MyRepo --schedule hourly --active false
  2. Update a schedule for a repository with a new entry.
    $ {{.HelpName}} --org MyOrg --repo MyRepo --schedule nightly --entry '@nightly'
  3. Update a schedule for a repository when config or environment variables are set.
    $ {{.HelpName}}

DOCUMENTATION:

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

CommandUpdate defines the command for modifying a schedule.

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

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

		&cli.StringFlag{
			EnvVars: []string{"VELA_SCHEDULE", "SCHEDULE_NAME"},
			Name:    internal.FlagSchedule,
			Aliases: []string{"s"},
			Usage:   "provide the name for the schedule",
		},

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

DOCUMENTATION:

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

CommandView defines the command for inspecting a schedule.

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