githubactions

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command *cli.Command = &cli.Command{
	Name:    commandName,
	Aliases: []string{"gha"},
	Usage:   "Add GitHub Actions to a project",
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:     "project-file",
			Aliases:  []string{"f"},
			Usage:    "The project file to use. We currently support .NET, Go or a generic project (Dockerfile).",
			Required: true,
		},
		&cli.StringFlag{
			Name:    "runtime-cloud-provider",
			Aliases: []string{"r"},
			Usage:   "The runtime cloud provider to use",
			Value:   "aks",
			Action: func(c *cli.Context, runtimeCloudProvider string) error {
				allowedRuntimeCloudProviders := []string{"aks", "gke", "iss"}
				if !slices.Contains(allowedRuntimeCloudProviders, strings.ToLower(runtimeCloudProvider)) {
					return cli.Exit(
						fmt.Sprintf(
							"Invalid runtime cloud provider '%s' provided: must be one of %v (ignoring case)",
							runtimeCloudProvider,
							allowedRuntimeCloudProviders),
						1,
					)
				}

				return nil
			},
		},
		&cli.StringFlag{
			Name:     "system-name",
			Aliases:  []string{"s"},
			Usage:    "The name of the system",
			Required: true,
		},
		&cli.StringFlag{
			Name:     "application-name",
			Aliases:  []string{"a"},
			Usage:    "The name of the application",
			Required: true,
		},
		&cli.StringFlag{
			Name:    "helm-values-path",
			Aliases: []string{"H"},
			Usage:   "The path to the Helm values file",
			Value:   ".github/deploy/values.yml",
		},
		&cli.StringFlag{
			Name:    "default-branch",
			Aliases: []string{"b"},
			Usage:   "The default branch of the repository",
			Value:   "trunk",
		},
	},
	Action: GitHubActions,
}

Functions

func GitHubActions

func GitHubActions(c *cli.Context) error

Types

type ReplaceWorkflowPlaceholdersOptions

type ReplaceWorkflowPlaceholdersOptions struct {
	DefaultBranch   string
	SystemName      string
	ApplicationName string
	HelmValuesPath  string
}

Jump to

Keyboard shortcuts

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