cmd

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package cmd defines commands of the application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Changelog added in v0.2.0

type Changelog struct {
	From           string            `` /* 137-byte string literal not displayed */
	To             string            `long:"to" env:"TO" description:"commit ref to end release notes to" default:"{{ last (filter semver tags) }}"`
	Timeout        time.Duration     `long:"timeout" env:"TIMEOUT" description:"timeout for assembling the release" default:"5m"`
	SquashCommitRx string            `long:"squash-commit-rx" env:"SQUASH_COMMIT_RX" description:"regexp to match squash commits" default:"(#\\d+)"`
	ConfLocation   string            `long:"conf-location" env:"CONF_LOCATION" description:"location to the config file" required:"true"`
	Extras         map[string]string `long:"extras" env:"EXTRAS" env-delim:"," description:"extra variables to use in the template"`

	Engine EngineGroup `group:"engine" namespace:"engine" env-namespace:"ENGINE"`
	Notify NotifyGroup `group:"notify" namespace:"notify" env-namespace:"NOTIFY"`
	Task   TaskGroup   `group:"task" namespace:"task" env-namespace:"TASK"`
}

Changelog builds the release-notes from the specified template ands sends it to the desired destinations (telegram, stdout (for CI), etc.).

func (Changelog) Execute added in v0.2.0

func (r Changelog) Execute(_ []string) error

Execute the release-notes command.

type EngineGroup added in v0.7.0

type EngineGroup struct {
	Type   string      `long:"type" env:"TYPE" choice:"github" choice:"gitlab" description:"type of the repository engine" required:"true"`
	Github GithubGroup `group:"github" namespace:"github" env-namespace:"GITHUB"`
	Gitlab GitlabGroup `group:"gitlab" namespace:"gitlab" env-namespace:"GITLAB"`
}

EngineGroup defines parameters for the engine.

func (EngineGroup) Build added in v0.7.0

Build builds the engine.

type GithubGroup

type GithubGroup struct {
	Repo struct {
		FullName string `long:"full-name" env:"FULL_NAME" description:"full name of the repository (owner/name)"`
		Owner    string `long:"owner" env:"OWNER" description:"owner of the repository"`
		Name     string `long:"name" env:"NAME" description:"name of the repository"`
	} `group:"repo" namespace:"repo" env-namespace:"REPO"`
	BasicAuth struct {
		Username string `long:"username" env:"USERNAME" description:"username for basic auth"`
		Password string `long:"password" env:"PASSWORD" description:"password for basic auth"`
	} `group:"basic-auth" namespace:"basic-auth" env-namespace:"BASIC_AUTH"`
	Timeout time.Duration `long:"timeout" env:"TIMEOUT" description:"timeout for http requests" default:"5s"`
}

GithubGroup defines parameters to connect to the github repository.

type GithubNotifierGroup

type GithubNotifierGroup struct {
	GithubGroup
	ReleaseNameTemplate string            `long:"release-name-tmpl" env:"RELEASE_NAME_TMPL" description:"template for release name"`
	Tag                 string            `long:"tag" env:"TAG" description:"tag to specify release"`
	Extras              map[string]string `long:"extra" env:"EXTRA" description:"extra parameters to pass to the notifier"`
}

GithubNotifierGroup defines parameters to make release in the github.

type GitlabGroup added in v0.7.0

type GitlabGroup struct {
	Token     string        `long:"token" env:"TOKEN" description:"token to connect to the gitlab repository"`
	BaseURL   string        `long:"base-url" env:"BASE_URL" description:"base url of the gitlab instance"`
	ProjectID string        `long:"project-id" env:"PROJECT_ID" description:"project id of the repository"`
	Timeout   time.Duration `long:"timeout" env:"TIMEOUT" description:"timeout for http requests" default:"5s"`
}

GitlabGroup defines parameters to connect to the gitlab repository.

type Jira added in v0.9.0

type Jira struct {
	URL     string        `long:"url" env:"URL" description:"url of the jira instance"`
	Token   string        `long:"token" env:"TOKEN" description:"token to connect to the jira instance"`
	Timeout time.Duration `long:"timeout" env:"TIMEOUT" description:"timeout for http requests" default:"5s"`
}

Jira defines parameters for the jira task tracker.

func (Jira) Build added in v0.9.0

func (r Jira) Build(ctx context.Context) (tengine.Interface, error)

Build builds the jira engine.

type MattermostBotGroup added in v0.8.0

type MattermostBotGroup struct {
	BaseURL   string        `long:"base-url" env:"BASE_URL" description:"base url for mattermost API"`
	Token     string        `long:"token" env:"TOKEN" description:"token of the mattermost bot"`
	ChannelID string        `long:"channel-id" env:"CHANNEL_ID" description:"channel id of the mattermost bot"`
	Timeout   time.Duration `long:"timeout" env:"TIMEOUT" description:"timeout for http requests" default:"5s"`
}

MattermostBotGroup defines parameters for mattermost bot notifier.

type MattermostHookGroup added in v0.8.0

type MattermostHookGroup struct {
	URL     string        `long:"url" env:"URL" description:"url of the mattermost hook"`
	Timeout time.Duration `long:"timeout" env:"TIMEOUT" description:"timeout for http requests" default:"5s"`
}

MattermostHookGroup defines parameters for mattermost hook notifier.

type NotifyGroup added in v0.7.0

type NotifyGroup struct {
	Telegram      TelegramGroup       `group:"telegram" namespace:"telegram" env-namespace:"TELEGRAM"`
	Github        GithubNotifierGroup `group:"github" namespace:"github" env-namespace:"GITHUB"`
	Mattermost    MattermostHookGroup `group:"mattermost-hook" namespace:"mattermost-hook" env-namespace:"MATTERMOST_HOOK"`
	MattermostBot MattermostBotGroup  `group:"mattermost-bot" namespace:"mattermost-bot" env-namespace:"MATTERMOST_BOT"`
	Post          PostGroup           `group:"post" namespace:"post" env-namespace:"POST"`
	Stdout        bool                `long:"stdout" env:"STDOUT" description:"print release notes to stdout"`
	Stderr        bool                `long:"stderr" env:"STDERR" description:"print release notes to stderr"`
}

NotifyGroup defines parameters for the notifier.

func (*NotifyGroup) Build added in v0.7.0

func (r *NotifyGroup) Build() (destinations notify.Destinations, err error)

Build builds the notifier.

type PostGroup added in v0.7.0

type PostGroup struct {
	URL     string        `long:"url" env:"URL" description:"url to send the release notes"`
	Timeout time.Duration `long:"timeout" env:"TIMEOUT" description:"timeout for http requests" default:"5s"`
}

PostGroup defines parameters for post notifier.

type Preview added in v0.6.0

type Preview struct {
	DataFile     string            `long:"data-file" env:"DATA_FILE" description:"path to the file with release data" required:"true"`
	Extras       map[string]string `` /* 152-byte string literal not displayed */
	ConfLocation string            `long:"conf-location" env:"CONF_LOCATION" description:"location to the config file" required:"true"`
}

Preview command prints the release notes to stdout.

func (Preview) Execute added in v0.6.0

func (p Preview) Execute(_ []string) error

Execute prints the release notes to stdout.

type TaskGroup added in v0.9.0

type TaskGroup struct {
	Type string `long:"type" env:"TYPE" choice:"" choice:"jira" description:"type of the task tracker"`
	Jira Jira   `group:"jira" namespace:"jira" env-namespace:"JIRA"`
}

TaskGroup defines parameters for task service

func (TaskGroup) Build added in v0.9.0

func (r TaskGroup) Build(ctx context.Context) (_ *tengine.Tracker, err error)

Build builds the task service.

type TelegramGroup

type TelegramGroup struct {
	ChatID         string        `long:"chat-id" env:"CHAT_ID" description:"id of the chat, where the release notes will be sent"`
	Token          string        `long:"token" env:"TOKEN" description:"bot token"`
	WebPagePreview bool          `long:"web-page-preview" env:"WEB_PAGE_PREVIEW" description:"request telegram to preview for web links"`
	Timeout        time.Duration `long:"timeout" env:"TIMEOUT" description:"timeout for http requests" default:"5s"`
}

TelegramGroup defines parameters for telegram notifier.

Jump to

Keyboard shortcuts

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