Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var UpdateCmd = &cobra.Command{ Use: "update [type] [env] [services ...]", Short: "Update the branch and commit for a selection of services, lambdas, or cloudfront distributions", Long: "Please read the README.md file", Example: strings.Join([]string{ "update service avocado sms email -b extra-logging", "update service avocado sms email -b extra-logging -c f1ec178befe6ed26ce9cec0aa419c763c203bc92", "update service all sms email -c 1ed6fd7450031a5240584f8bbe8ec527f9020b5b", "update service prod email --prod", "update lambda basil ltm-proxy", "update cloudfront prod website --prod", "update terra avocado aws-env", }, "\n"), Aliases: []string{"u"}, Args: updateArgs, RunE: func(cmd *cobra.Command, args []string) error { ctx := context.Background() branch, err := cmd.Flags().GetString("branch") if err != nil { return err } useProd, err := cmd.Flags().GetBool("prod") if err != nil { return err } dryRun, err := cmd.Flags().GetBool("dry-run") if err != nil { return nil } message, err := cmd.Flags().GetString("message") if err != nil { return err } commit, err := cmd.Flags().GetString("commit") if err != nil { return err } params, err := parsers.Parse(args, useProd) if err != nil { return err } params.Branch = branch params.Message = message params.Commit = commit awsSession, err := session.NewSessionWithOptions(session.Options{ Profile: "root", Config: aws.Config{ Region: ptr.String("eu-west-1"), Credentials: config.AWS{}.Credentials(), }, }) if err != nil { return errors.Wrap(err, "aws:") } sns := sns.New(awsSession) a := &app.App{ DryRun: dryRun, SNS: sns, } overruleChecks, err := cmd.Flags().GetStringSlice("overrule-checks") if err != nil { return err } return a.Update(ctx, params, overruleChecks) }, }
UpdateCmd is the initiator for the update command
View Source
var UpdateDefaultCmd = &cobra.Command{ Use: "update-default [type] [env]", Short: "Update the default commit for all services or lambdas", Long: "Please read the README.md file", Example: strings.Join([]string{ "update-default services avocado", "update-default services avocado -c f1ec178befe6ed26ce9cec0aa419c763c203bc92", "update-default lambda all", }, "\n"), Args: updateDefaultArgs, RunE: func(cmd *cobra.Command, args []string) error { ctx := context.Background() useProd, err := cmd.Flags().GetBool("prod") if err != nil { return err } dryRun, err := cmd.Flags().GetBool("dry-run") if err != nil { return nil } message, err := cmd.Flags().GetString("message") if err != nil { return err } commit, err := cmd.Flags().GetString("commit") if err != nil { return err } params, err := parsers.Parse(args, useProd) if err != nil { return err } params.Branch = cdep.DefaultBranch params.Message = message params.Commit = commit awsSession, err := session.NewSessionWithOptions(session.Options{ Profile: "root", Config: aws.Config{ Region: ptr.String("eu-west-1"), Credentials: config.AWS{}.Credentials(), }, }) if err != nil { return errors.Wrap(err, "aws:") } sns := sns.New(awsSession) a := &app.App{ DryRun: dryRun, SNS: sns, } overruleChecks, err := cmd.Flags().GetStringSlice("overrule-checks") if err != nil { return err } return a.UpdateDefault(ctx, params, overruleChecks) }, }
UpdateDefaultCmd is the update-default command
View Source
var UpdateWebCmd = &cobra.Command{ Use: "update-web [type] [env] [services ...]", Short: "Update the deployment identifier for web applications ", Long: "Please read the README.md file", Example: strings.Join([]string{ "update-web cloudfront all website", "uw cf prod website --prod", "uw cf prod website -b new-landing-page --prod", }, "\n"), Aliases: []string{"uw"}, Args: updateWebArgs, RunE: func(cmd *cobra.Command, args []string) error { ctx := context.Background() branch, err := cmd.Flags().GetString("branch") if err != nil { return err } useProd, err := cmd.Flags().GetBool("prod") if err != nil { return err } dryRun, err := cmd.Flags().GetBool("dry-run") if err != nil { return nil } params, err := parsers.ParseWeb(args, branch, useProd) if err != nil { return err } a := &app.App{ DryRun: dryRun, } overruleChecks, err := cmd.Flags().GetStringSlice("overrule-checks") if err != nil { return err } return a.UpdateWeb(ctx, params, overruleChecks) }, }
UpdateWebCmd is the initiator for the update command
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.