Beispiel #1
0
func NewReleasesCmd(e *parsecli.Env) *cobra.Command {
	r := &releasesCmd{}
	cmd := &cobra.Command{
		Use:   "releases [app]",
		Short: "Gets the Heroku releases for a Parse app",
		Long:  "Prints the last 10 releases made on Heroku",
		Run:   parsecli.RunWithClient(e, r.run),
	}
	return cmd
}
Beispiel #2
0
func NewDownloadCmd(e *parsecli.Env) *cobra.Command {
	d := &downloadCmd{}
	cmd := &cobra.Command{
		Use:   "download",
		Short: "Downloads the latest deployed server code from Heroku servers",
		Long:  "Downloads the latest deployed server code from Heroku servers.",
		Run:   parsecli.RunWithClient(e, d.run),
	}
	return cmd
}
Beispiel #3
0
func NewRollbackCmd(e *parsecli.Env) *cobra.Command {
	r := rollbackCmd{}
	cmd := &cobra.Command{
		Use:   "rollback [app]",
		Short: "Rolls back the version for given app at Heroku",
		Long:  "Rolls back the version for given app at Heroku.",
		Run:   parsecli.RunWithClient(e, r.run),
	}
	cmd.Flags().StringVarP(&r.ReleaseName, "release", "r", r.ReleaseName, "The release to rollback to")
	return cmd
}
Beispiel #4
0
func NewRollbackCmd(e *parsecli.Env) *cobra.Command {
	r := rollbackCmd{}
	cmd := &cobra.Command{
		Use:   "rollback [app]",
		Short: "Rolls back the version for the given app",
		Long:  "Rolls back the version for the given app.",
		Run:   parsecli.RunWithClient(e, r.run),
	}
	cmd.Flags().StringVarP(&r.ReleaseName, "release", "r", r.ReleaseName,
		"Provides an optional release to rollback to. If no release is provided, rolls back to the previous release.")
	return cmd
}
Beispiel #5
0
func NewReleasesCmd(e *parsecli.Env) *cobra.Command {
	r := &releasesCmd{}
	cmd := &cobra.Command{
		Use:   "releases [app]",
		Short: "Gets the releases for a Parse App",
		Long:  "Prints the releases the server knows about.",
		Run:   parsecli.RunWithClient(e, r.run),
	}
	cmd.Flags().StringVarP(&r.version, "version", "v", r.version,
		"List files names of the deployed version.")
	return cmd
}
Beispiel #6
0
func NewLogsCmd(e *parsecli.Env) *cobra.Command {
	h := &logsCmd{num: 50}
	cmd := &cobra.Command{
		Use:   "logs",
		Short: "Fetch logs from heroku",
		Long:  "Fetch logs from heroku.",
		Run:   parsecli.RunWithClient(e, h.run),
	}
	cmd.Flags().BoolVarP(&h.tail, "follow", "f", h.tail, "Tail logs from server.")
	cmd.Flags().IntVarP(&h.num, "num", "n", h.num, "Number of log lines to fetch.")
	return cmd
}
Beispiel #7
0
func NewDeployCmd(e *parsecli.Env) *cobra.Command {
	var d deployCmd
	cmd := &cobra.Command{
		Use:   "deploy [app]",
		Short: "Deploys server code to Heroku",
		Long:  "Deploys server code to Heroku.",
		Run:   parsecli.RunWithClient(e, d.deploy),
	}
	cmd.Flags().BoolVarP(&d.Force, "force", "f", d.Force,
		"Forcefully deploy current contents even if they differ hugely from existing deploy.")
	cmd.Flags().StringVarP(&d.Description, "description", "d", d.Description,
		"Description is used as git commit message, if repo is dirty, before pushing to Heroku remote.")
	return cmd
}
Beispiel #8
0
func NewFunctionHooksCmd(e *parsecli.Env) *cobra.Command {
	h := &functionHooksCmd{interactive: true}

	c := &cobra.Command{
		Use:   "functions",
		Short: "List Cloud Code functions and function webhooks",
		Long:  "List Cloud Code functions and function webhooks",
		Run:   parsecli.RunWithClient(e, h.functionHooks),
	}

	createCmd := &cobra.Command{
		Use:   "create",
		Short: "Create a function webhook",
		Long:  "Create a function webhook",
		Run:   parsecli.RunWithClient(e, h.functionHooksCreate),
	}
	c.AddCommand(createCmd)

	changeCmd := &cobra.Command{
		Use:   "edit",
		Short: "Edit the URL of a function webhook",
		Long:  "Edit the URL of a function webhook",
		Run:   parsecli.RunWithClient(e, h.functionHooksUpdate),
	}
	c.AddCommand(changeCmd)

	deleteCmd := &cobra.Command{
		Use:   "delete",
		Short: "Delete a function webhook",
		Long:  "Delete a function webhook",
		Run:   parsecli.RunWithClient(e, h.functionHooksDelete),
	}
	c.AddCommand(deleteCmd)

	return c
}
Beispiel #9
0
func NewDownloadCmd(e *parsecli.Env) *cobra.Command {
	d := &downloadCmd{}
	cmd := &cobra.Command{
		Use:   "download [app]",
		Short: "Downloads the Cloud Code project",
		Long: `Downloads the Cloud Code project at a given location,
or at a temporary location if nothing is explicitly provided through the -l flag.
`,
		Run: parsecli.RunWithClient(e, d.run),
	}
	cmd.Flags().BoolVarP(&d.force, "force", "f", d.force,
		"Force will overwrite any files in the current project directory")
	cmd.Flags().StringVarP(&d.destination, "location", "l", d.destination,
		"Download Cloud Code project at the given location.")
	return cmd
}
Beispiel #10
0
func NewLogsCmd(e *parsecli.Env) *cobra.Command {
	l := logsCmd{
		level: "INFO",
	}
	cmd := &cobra.Command{
		Use:     "logs",
		Short:   "Prints out recent log messages",
		Long:    "Prints out recent log messages.",
		Run:     parsecli.RunWithClient(e, l.run),
		Aliases: []string{"log"},
	}
	cmd.Flags().UintVarP(&l.num, "num", "n", l.num,
		"The number of the messages to display")
	cmd.Flags().BoolVarP(&l.follow, "follow", "f", l.follow,
		"Emulates tail -f and streams new messages from the server")
	cmd.Flags().StringVarP(&l.level, "level", "l", l.level,
		"The log level to restrict to. Can be 'INFO' or 'ERROR'.")
	return cmd
}
Beispiel #11
0
func NewSymbolsCmd(e *parsecli.Env) *cobra.Command {
	var s symbolsCmd
	cmd := &cobra.Command{
		Use:   "symbols [app]",
		Short: "Uploads symbol files",
		Long: `Uploads the symbol files for the application to symbolicate crash reports with.
Path specifies the path to xcarchive/dSYM/DWARF for iOS or mapping.txt for Android.`,
		Run: parsecli.RunWithClient(e, s.run),
	}
	cmd.Flags().StringVarP(&s.path, "path", "p", s.path,
		"Path to symbols files")
	cmd.Flags().StringVarP(&s.apk, "apk", "a", s.apk,
		"Path to apk file")
	cmd.Flags().StringVarP(&s.manifest, "manifest", "m", s.manifest,
		"Path to AndroidManifest.xml file")
	cmd.Flags().StringVarP(&s.aapt, "aapt", "t", s.aapt,
		"Path to aapt for android")
	return cmd
}
Beispiel #12
0
func NewDeployCmd(e *parsecli.Env) *cobra.Command {
	d := deployCmd{
		Verbose: true,
		Retries: 3,
		wait:    func(n int) time.Duration { return time.Duration(n) * time.Second },
	}

	cmd := &cobra.Command{
		Use:   "deploy [app]",
		Short: "Deploys a Parse App",
		Long:  `Deploys the code to the given app.`,
		Run:   parsecli.RunWithClient(e, d.run),
	}
	cmd.Flags().StringVarP(&d.Description, "description", "d", d.Description,
		"Add an optional description to the deploy")
	cmd.Flags().BoolVarP(&d.Force, "force", "f", d.Force,
		"Force deploy files even if their content is unchanged")
	cmd.Flags().BoolVarP(&d.Verbose, "verbose", "v", d.Verbose,
		"Control verbosity of cmd line logs")
	cmd.Flags().IntVarP(&d.Retries, "retries", "n", d.Retries,
		"Max number of retries to perform until first successful deploy")
	return cmd
}