Skip to content

Commit

Permalink
Add --disable-build-webhook flag for app creation
Browse files Browse the repository at this point in the history
Useful if you're managing your own build process or you've hit GitHub's
20 webhook limit on a repo.
  • Loading branch information
ipmb committed Oct 29, 2021
1 parent 6788c5c commit 2d236de
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,12 @@ func createAppOrPipeline(cmd *cobra.Command, args []string, pipeline bool) {
} else {
fargateParameter = "enabled"
}
var buildWebhookParameter string
if isTruthy(aws.String(cmd.Flags().Lookup("disable-build-webhook").Value.String())) {
buildWebhookParameter = "disabled"
} else {
buildWebhookParameter = "enabled"
}
rand.Seed(time.Now().UnixNano())

input := cloudformation.CreateStackInput{
Expand Down Expand Up @@ -919,6 +925,10 @@ func createAppOrPipeline(cmd *cobra.Command, args []string, pipeline bool) {
ParameterKey: aws.String("AllowedUsers"),
ParameterValue: aws.String(strings.Trim(*(getArgValue(cmd, &answers, "users", true)), "[]")),
},
{
ParameterKey: aws.String("BuildWebhook"),
ParameterValue: &buildWebhookParameter,
},
},
Capabilities: []*string{aws.String("CAPABILITY_IAM")},
Tags: cfnTags,
Expand Down Expand Up @@ -1044,6 +1054,7 @@ func init() {
appCmd.Flags().Bool("addon-ses", false, "setup SES (Email) add-on (requires manual approval of domain at SES)")
appCmd.Flags().String("addon-ses-domain", "*", "domain approved for sending via SES add-on. Use '*' for all domains.")
appCmd.Flags().StringSliceP("users", "u", []string{}, "email addresses for users who can manage the app (comma separated)")
appCmd.Flags().Bool("disable-build-webhook", false, "disable creation of a webhook on the repo to automatically trigger builds on push")

createCmd.AddCommand(pipelineCmd)
pipelineCmd.Flags().SortFlags = false
Expand Down

0 comments on commit 2d236de

Please sign in to comment.