cmd

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExportCmd = &cobra.Command{
	Use:   "export",
	Short: "Exports organization and repository variables to CSV",
	Long:  "Exports organization and repository variables to CSV",
	Run: func(cmd *cobra.Command, args []string) {
		GetFlagOrViperValue(cmd, map[string]bool{
			"source-hostname":     false,
			"source-organization": true,
			"source-token":        true,
			"search-depth":        false,
		})
		ShowConnectionStatus("export")
		if err := export.ExportVariables(); err != nil {
			fmt.Printf("failed to export variables: %v\n", err)
		}
		return
	},
}

exportCmd represents the export command

View Source
var SyncCmd = &cobra.Command{
	Use:   "sync",
	Short: "Sync organization and repository variables from CSV",
	Long:  "Sync organization and repository variables from CSV",
	Run: func(cmd *cobra.Command, args []string) {
		GetFlagOrViperValue(cmd, map[string]bool{
			"file":                true,
			"target-hostname":     false,
			"target-organization": true,
			"target-token":        true,
		})

		ShowConnectionStatus("sync")

		if err := sync.SyncVariables(); err != nil {
			fmt.Printf("failed to export variables: %v\n", err)
		}
		return
	},
}

Functions

func Execute

func Execute() error

func GetFlagOrViperValue

func GetFlagOrViperValue(cmd *cobra.Command, flags map[string]bool) map[string]string

func ShowConnectionStatus

func ShowConnectionStatus(actionType string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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