Exemplo n.º 1
0
func initDeploymentFlags(fs *pflag.FlagSet, f *fg.Flags) {
	fs.StringVarP(&f.JobPath, "job", "j", defaultJobPath, "filename of the job description")
	fs.StringVarP(&f.ClusterPath, "cluster", "c", defaultClusterPath, "cluster description name or filename")
	fs.StringVarP(&f.TunnelOverride, "tunnel", "t", defaultTunnelOverride, "SSH endpoint to tunnel through with fleet (cluster override)")
	fs.StringSliceVarP(&f.Groups, "groups", "g", defaultGroups, "target task groups to deploy")
	fs.BoolVarP(&f.Force, "force", "f", defaultForce, "wheather to confirm destroy or not")
	fs.BoolVarP(&f.AutoContinue, "yes", "y", false, "auto continue on confirmation")
	fs.BoolVarP(&f.DryRun, "dry-run", "d", defaultDryRun, "wheather to schedule units or not")
	fs.UintVar(&f.ScalingGroup, "scaling-group", defaultScalingGroup, "scaling group to deploy")
	fs.BoolVarP(&f.Local, "local", "l", defaultLocal, "User local vagrant test cluster")
	fs.DurationVar(&f.StopDelay, "stop-delay", defaultStopDelay, "Time between stop and destroy")
	fs.DurationVar(&f.DestroyDelay, "destroy-delay", defaultDestroyDelay, "Time between destroy and re-create")
	fs.DurationVar(&f.SliceDelay, "slice-delay", defaultSliceDelay, "Time between update of scaling slices")
	fs.VarP(&f.Options, "option", "o", "Set an option (key=value)")

	f.VaultCACert = os.Getenv("VAULT_CACERT")
	f.VaultCAPath = os.Getenv("VAULT_CAPATH")
	fs.StringVar(&f.VaultAddr, "vault-addr", "", "URL of the vault (defaults to VAULT_ADDR environment variable)")
	fs.StringVar(&f.VaultCACert, "vault-cacert", f.VaultCACert, "Path to a PEM-encoded CA cert file to use to verify the Vault server SSL certificate")
	fs.StringVar(&f.VaultCAPath, "vault-capath", f.VaultCAPath, "Path to a directory of PEM-encoded CA cert files to verify the Vault server SSL certificate")
	fs.StringVarP(&f.GithubToken, "github-token", "G", "", "Personal github token for secret logins")
	fs.StringVar(&f.GithubTokenPath, "github-token-path", defaultGithubTokenPath, "Path of a file containing your github token")
}