cmd

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvPrefix = "ARTEFACTOR_"
	// FlagDockerImages specifies a to newline seperated list of docker images to save
	FlagDockerImages = "docker-images"
	// FlagArchiveDir is the directory to save archives into
	FlagArchiveDir = "archive-dir"
	// FlagGitRepos specifies a newline seperated list of local or remote git repos
	FlagGitRepos = "git-repos"
	// FlagWebFiles specifies a whitespace delimited set of csv's with:
	// url,file,md5,[true|false (executable)]
	FlagWebFiles = "web-files"
	// FlagLogs enabled debug logs
	FlagLogs = "logs"
	// FlagTargetPlatform allows the correct version of artefactor to be saved
	// with files.
	FlagTargetPlatform = "target-platform"
	// FlagImageVars is used to specify a whitelist of variable names to enable
	// "export"
	FlagImageVars = "image-vars"
	// FlagDockerUserName overrides docker registry configuration
	FlagDockerUserName = "docker-username"
	// FlagDockerPassword overrides docker registry configuration
	FlagDockerPassword = "docker-password"
	// FlagDockerPasswordHelp is displayed when getting help for the flag
	FlagDockerPasswordHelp = "overrides docker registry configuration for password"
	// FlagDockerUserNameHelp is displayed when getting help for the flag
	FlagDockerUserNameHelp = "overrides docker registry configuration for username"
	// DefaultArchiveDir
	DefaultArchiveDir = "downloads"
	// DefaultTargetPlatform is the default binary type to include in downloads
	DefaultTargetPlatform = "linux_amd64"
)
View Source
const (
	FlagDockerRegistry string = "docker-registry"
	// PublishCommand is the sub command syntax
	PublishCommand string = "publish"
)
View Source
const (
	RestoreCommand       string = "restore"
	FlagRestoreSourceDir string = "source-dir"
	FlagRestoreDestDir   string = "dest-dir"
)

SaveCommand is the sub command syntax

View Source
const (
	SaveCommand           string = "save"
	SaveDirMetaFile       string = "saveDir.meta"
	ArtefactorBinaryName  string = "artefactor"
	ArtefactorPublishRoot string = "https://github.com/appvia/artefactor/releases/download/%s/"
)

SaveCommand is the sub command syntax

View Source
const (
	// CleanCmd is the sub command syntax
	CleanCmd string = "clean"
)
View Source
const (
	// ImageNamesCommand is the sub command syntax
	ImageNamesCommand string = "update-image-vars"
)

Variables

View Source
var (
	// RootCmd represents the base command when called without any subcommands
	RootCmd = &cobra.Command{
		Use:   "artefactor",
		Short: "artefactor saves things to files",
		Long:  "artefactor saves docker containers, git repos and web files to, err, files",
		RunE: func(c *cobra.Command, args []string) error {
			common(c)
			if c.Flags().Changed("version") {
				printVersion()
				return nil
			}
			return c.Usage()
		},
	}
)

Functions

func Execute

func Execute()

Execute adds all child commands to the root command sets flags appropriately. This is called by main(). It only needs to happen once to the rootCmd.

func GetEnvName

func GetEnvName(flagName string) string

func RestoreHome

func RestoreHome(gitRepoFile string, dst string, savedDir string) error

RestoreHome will restore the current repo and move all other archive files as specified in the checksums file

Types

This section is empty.

Jump to

Keyboard shortcuts

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