bootstraptenantconfigrepo

package
v0.0.30 Latest Latest
Warning

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

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

Documentation

Overview

Package bootstraptenantconfigrepo provides facilities for the sfconfig CLI Generates pipelines, jobs and playbooks for zuul

Index

Constants

This section is empty.

Variables

View Source
var BootstrapTenantConfigRepoCmd = &cobra.Command{
	Use:   "bootstrap-tenant",
	Short: "bootstrap a tenant's config repository",
	Long: `Initialize a Zuul tenant's config repository
with boilerplate code that define standard pipelines:

* "check" for pre-commit validation
* "gate" for approved commits gating
* "post for post-commit actions

it also includes a boilerplate job and pre-run playbook.

This will generate the following files:
<Path to Project>/zuul.d/<CONNECTION NAME>-base-jobs.yaml
<Path to Project>/zuul.d/<CONNECTION NAME>-pipeline.yaml
<Path to Project>/playbooks/<CONNECTION NAME>-pre.yaml

Note: If the directories does not exit they will be created.

	`,
	Run: func(cmd *cobra.Command, args []string) {

		connection, _ := cmd.Flags().GetString("connection")
		driver, _ := cmd.Flags().GetString("driver")

		if len(args) != 1 {
			ctrl.Log.Error(errors.New("incorrect argument"), "the command accepts only one argument as destination path")
			os.Exit(1)
		}
		outpath := args[0]

		InitConfigRepo(driver, connection, outpath)

		ctrl.Log.Info("Repository bootstrapped at " + outpath)
	},
}

BootstrapTenantConfigRepoCmd command

Functions

func InitConfigRepo

func InitConfigRepo(driver string, connection string, zuulrootdir string)

func MkBootstrapCmd

func MkBootstrapCmd() *cobra.Command

Types

This section is empty.

Jump to

Keyboard shortcuts

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