1# Copyright 2020 Google LLC
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15apiVersion: apiextensions.k8s.io/v1
16kind: CustomResourceDefinition
17metadata:
18 annotations:
19 cnrm.cloud.google.com/version: 1.106.0
20 creationTimestamp: null
21 labels:
22 cnrm.cloud.google.com/managed-by-kcc: "true"
23 cnrm.cloud.google.com/stability-level: stable
24 cnrm.cloud.google.com/system: "true"
25 cnrm.cloud.google.com/tf2crd: "true"
26 name: cloudbuildtriggers.cloudbuild.cnrm.cloud.google.com
27spec:
28 group: cloudbuild.cnrm.cloud.google.com
29 names:
30 categories:
31 - gcp
32 kind: CloudBuildTrigger
33 plural: cloudbuildtriggers
34 shortNames:
35 - gcpcloudbuildtrigger
36 - gcpcloudbuildtriggers
37 singular: cloudbuildtrigger
38 scope: Namespaced
39 versions:
40 - additionalPrinterColumns:
41 - jsonPath: .metadata.creationTimestamp
42 name: Age
43 type: date
44 - description: When 'True', the most recent reconcile of the resource succeeded
45 jsonPath: .status.conditions[?(@.type=='Ready')].status
46 name: Ready
47 type: string
48 - description: The reason for the value in 'Ready'
49 jsonPath: .status.conditions[?(@.type=='Ready')].reason
50 name: Status
51 type: string
52 - description: The last transition time for the value in 'Status'
53 jsonPath: .status.conditions[?(@.type=='Ready')].lastTransitionTime
54 name: Status Age
55 type: date
56 name: v1beta1
57 schema:
58 openAPIV3Schema:
59 properties:
60 apiVersion:
61 description: 'apiVersion defines the versioned schema of this representation
62 of an object. Servers should convert recognized schemas to the latest
63 internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#resources'
64 type: string
65 kind:
66 description: 'kind is a string value representing the REST resource this
67 object represents. Servers may infer this from the endpoint the client
68 submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds'
69 type: string
70 metadata:
71 type: object
72 spec:
73 properties:
74 approvalConfig:
75 description: |-
76 Configuration for manual approval to start a build invocation of this BuildTrigger.
77 Builds created by this trigger will require approval before they execute.
78 Any user with a Cloud Build Approver role for the project can approve a build.
79 properties:
80 approvalRequired:
81 description: |-
82 Whether or not approval is needed. If this is set on a build, it will become pending when run,
83 and will need to be explicitly approved to start.
84 type: boolean
85 type: object
86 bitbucketServerTriggerConfig:
87 description: BitbucketServerTriggerConfig describes the configuration
88 of a trigger that creates a build whenever a Bitbucket Server event
89 is received.
90 properties:
91 bitbucketServerConfigResourceRef:
92 description: |-
93 Only `external` field is supported to configure the reference.
94
95 The full resource name of the bitbucket server config. Format:
96 projects/{project}/locations/{location}/bitbucketServerConfigs/{id}.
97 oneOf:
98 - not:
99 required:
100 - external
101 required:
102 - name
103 - not:
104 anyOf:
105 - required:
106 - name
107 - required:
108 - namespace
109 required:
110 - external
111 properties:
112 external:
113 description: 'Allowed value: The `name` field of a `CloudBuildBitbucketServerConfig`
114 resource.'
115 type: string
116 name:
117 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
118 type: string
119 namespace:
120 description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
121 type: string
122 type: object
123 projectKey:
124 description: 'Key of the project that the repo is in. For example:
125 The key for https://mybitbucket.server/projects/TEST/repos/test-repo
126 is "TEST".'
127 type: string
128 pullRequest:
129 description: Filter to match changes in pull requests.
130 properties:
131 branch:
132 description: |-
133 Regex of branches to match.
134 The syntax of the regular expressions accepted is the syntax accepted by RE2 and described at https://github.com/google/re2/wiki/Syntax.
135 type: string
136 commentControl:
137 description: 'Configure builds to run whether a repository
138 owner or collaborator need to comment /gcbrun. Possible
139 values: ["COMMENTS_DISABLED", "COMMENTS_ENABLED", "COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY"].'
140 type: string
141 invertRegex:
142 description: If true, branches that do NOT match the git_ref
143 will trigger a build.
144 type: boolean
145 required:
146 - branch
147 type: object
148 push:
149 description: Filter to match changes in refs like branches, tags.
150 properties:
151 branch:
152 description: Regex of branches to match. Specify only one
153 of branch or tag.
154 type: string
155 invertRegex:
156 description: When true, only trigger a build if the revision
157 regex does NOT match the gitRef regex.
158 type: boolean
159 tag:
160 description: Regex of tags to match. Specify only one of
161 branch or tag.
162 type: string
163 type: object
164 repoSlug:
165 description: |-
166 Slug of the repository. A repository slug is a URL-friendly version of a repository name, automatically generated by Bitbucket for use in the URL.
167 For example, if the repository name is 'test repo', in the URL it would become 'test-repo' as in https://mybitbucket.server/projects/TEST/repos/test-repo.
168 type: string
169 required:
170 - bitbucketServerConfigResourceRef
171 - projectKey
172 - repoSlug
173 type: object
174 build:
175 description: Contents of the build template. Either a filename or
176 build template must be provided.
177 properties:
178 artifacts:
179 description: Artifacts produced by the build that should be uploaded
180 upon successful completion of all build steps.
181 properties:
182 images:
183 description: |-
184 A list of images to be pushed upon the successful completion of all build steps.
185
186 The images will be pushed using the builder service account's credentials.
187
188 The digests of the pushed images will be stored in the Build resource's results field.
189
190 If any of the images fail to be pushed, the build is marked FAILURE.
191 items:
192 type: string
193 type: array
194 objects:
195 description: |-
196 A list of objects to be uploaded to Cloud Storage upon successful completion of all build steps.
197
198 Files in the workspace matching specified paths globs will be uploaded to the
199 Cloud Storage location using the builder service account's credentials.
200
201 The location and generation of the uploaded objects will be stored in the Build resource's results field.
202
203 If any objects fail to be pushed, the build is marked FAILURE.
204 properties:
205 location:
206 description: |-
207 Cloud Storage bucket and optional object path, in the form "gs://bucket/path/to/somewhere/".
208
209 Files in the workspace matching any path pattern will be uploaded to Cloud Storage with
210 this location as a prefix.
211 type: string
212 paths:
213 description: Path globs used to match files in the build's
214 workspace.
215 items:
216 type: string
217 type: array
218 timing:
219 description: Output only. Stores timing information for
220 pushing all artifact objects.
221 items:
222 properties:
223 endTime:
224 description: |-
225 End of time span.
226
227 A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to
228 nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
229 type: string
230 startTime:
231 description: |-
232 Start of time span.
233
234 A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to
235 nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".
236 type: string
237 type: object
238 type: array
239 type: object
240 type: object
241 availableSecrets:
242 description: Secrets and secret environment variables.
243 properties:
244 secretManager:
245 description: Pairs a secret environment variable with a SecretVersion
246 in Secret Manager.
247 items:
248 properties:
249 env:
250 description: |-
251 Environment variable name to associate with the secret. Secret environment
252 variables must be unique across all of a build's secrets, and must be used
253 by at least one build step.
254 type: string
255 versionRef:
256 oneOf:
257 - not:
258 required:
259 - external
260 required:
261 - name
262 - not:
263 anyOf:
264 - required:
265 - name
266 - required:
267 - namespace
268 required:
269 - external
270 properties:
271 external:
272 description: 'Allowed value: The `name` field of
273 a `SecretManagerSecretVersion` resource.'
274 type: string
275 name:
276 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
277 type: string
278 namespace:
279 description: 'Namespace of the referent. More info:
280 https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
281 type: string
282 type: object
283 required:
284 - env
285 - versionRef
286 type: object
287 type: array
288 required:
289 - secretManager
290 type: object
291 images:
292 description: |-
293 A list of images to be pushed upon the successful completion of all build steps.
294 The images are pushed using the builder service account's credentials.
295 The digests of the pushed images will be stored in the Build resource's results field.
296 If any of the images fail to be pushed, the build status is marked FAILURE.
297 items:
298 type: string
299 type: array
300 logsBucketRef:
301 description: |-
302 Google Cloud Storage bucket where logs should be written. Logs file
303 names will be of the format ${logsBucket}/log-${build_id}.txt.
304 oneOf:
305 - not:
306 required:
307 - external
308 required:
309 - name
310 - not:
311 anyOf:
312 - required:
313 - name
314 - required:
315 - namespace
316 required:
317 - external
318 properties:
319 external:
320 description: 'Allowed value: The `url` field of a `StorageBucket`
321 resource.'
322 type: string
323 name:
324 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
325 type: string
326 namespace:
327 description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
328 type: string
329 type: object
330 options:
331 description: Special options for this build.
332 properties:
333 diskSizeGb:
334 description: |-
335 Requested disk size for the VM that runs the build. Note that this is NOT "disk free";
336 some of the space will be used by the operating system and build utilities.
337 Also note that this is the minimum disk size that will be allocated for the build --
338 the build may run with a larger disk than requested. At present, the maximum disk size
339 is 1000GB; builds that request more than the maximum are rejected with an error.
340 type: integer
341 dynamicSubstitutions:
342 description: |-
343 Option to specify whether or not to apply bash style string operations to the substitutions.
344
345 NOTE this is always enabled for triggered builds and cannot be overridden in the build configuration file.
346 type: boolean
347 env:
348 description: |-
349 A list of global environment variable definitions that will exist for all build steps
350 in this build. If a variable is defined in both globally and in a build step,
351 the variable will use the build step value.
352
353 The elements are of the form "KEY=VALUE" for the environment variable "KEY" being given the value "VALUE".
354 items:
355 type: string
356 type: array
357 logStreamingOption:
358 description: 'Option to define build log streaming behavior
359 to Google Cloud Storage. Possible values: ["STREAM_DEFAULT",
360 "STREAM_ON", "STREAM_OFF"].'
361 type: string
362 logging:
363 description: 'Option to specify the logging mode, which determines
364 if and where build logs are stored. Possible values: ["LOGGING_UNSPECIFIED",
365 "LEGACY", "GCS_ONLY", "STACKDRIVER_ONLY", "CLOUD_LOGGING_ONLY",
366 "NONE"].'
367 type: string
368 machineType:
369 description: 'Compute Engine machine type on which to run
370 the build. Possible values: ["UNSPECIFIED", "N1_HIGHCPU_8",
371 "N1_HIGHCPU_32", "E2_HIGHCPU_8", "E2_HIGHCPU_32"].'
372 type: string
373 requestedVerifyOption:
374 description: 'Requested verifiability options. Possible values:
375 ["NOT_VERIFIED", "VERIFIED"].'
376 type: string
377 secretEnv:
378 description: |-
379 A list of global environment variables, which are encrypted using a Cloud Key Management
380 Service crypto key. These values must be specified in the build's Secret. These variables
381 will be available to all build steps in this build.
382 items:
383 type: string
384 type: array
385 sourceProvenanceHash:
386 description: 'Requested hash for SourceProvenance. Possible
387 values: ["NONE", "SHA256", "MD5"].'
388 items:
389 type: string
390 type: array
391 substitutionOption:
392 description: |-
393 Option to specify behavior when there is an error in the substitution checks.
394
395 NOTE this is always set to ALLOW_LOOSE for triggered builds and cannot be overridden
396 in the build configuration file. Possible values: ["MUST_MATCH", "ALLOW_LOOSE"].
397 type: string
398 volumes:
399 description: |-
400 Global list of volumes to mount for ALL build steps
401
402 Each volume is created as an empty volume prior to starting the build process.
403 Upon completion of the build, volumes and their contents are discarded. Global
404 volume names and paths cannot conflict with the volumes defined a build step.
405
406 Using a global volume in a build with only one step is not valid as it is indicative
407 of a build request with an incorrect configuration.
408 items:
409 properties:
410 name:
411 description: |-
412 Name of the volume to mount.
413
414 Volume names must be unique per build step and must be valid names for Docker volumes.
415 Each named volume must be used by at least two build steps.
416 type: string
417 path:
418 description: |-
419 Path at which to mount the volume.
420
421 Paths must be absolute and cannot conflict with other volume paths on the same
422 build step or with certain reserved volume paths.
423 type: string
424 type: object
425 type: array
426 workerPool:
427 description: |-
428 Option to specify a WorkerPool for the build. Format projects/{project}/workerPools/{workerPool}
429
430 This field is experimental.
431 type: string
432 type: object
433 queueTtl:
434 description: |-
435 TTL in queue for this build. If provided and the build is enqueued longer than this value,
436 the build will expire and the build status will be EXPIRED.
437 The TTL starts ticking from createTime.
438 A duration in seconds with up to nine fractional digits, terminated by 's'. Example: "3.5s".
439 type: string
440 secret:
441 description: Secrets to decrypt using Cloud Key Management Service.
442 items:
443 properties:
444 kmsKeyRef:
445 description: KMS crypto key to use to decrypt these envs.
446 oneOf:
447 - not:
448 required:
449 - external
450 required:
451 - name
452 - not:
453 anyOf:
454 - required:
455 - name
456 - required:
457 - namespace
458 required:
459 - external
460 properties:
461 external:
462 description: 'Allowed value: The `selfLink` field of
463 a `KMSCryptoKey` resource.'
464 type: string
465 name:
466 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
467 type: string
468 namespace:
469 description: 'Namespace of the referent. More info:
470 https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
471 type: string
472 type: object
473 secretEnv:
474 additionalProperties:
475 type: string
476 description: |-
477 Map of environment variable name to its encrypted value.
478 Secret environment variables must be unique across all of a build's secrets,
479 and must be used by at least one build step. Values can be at most 64 KB in size.
480 There can be at most 100 secret values across all of a build's secrets.
481 type: object
482 required:
483 - kmsKeyRef
484 type: object
485 type: array
486 source:
487 description: |-
488 The location of the source files to build.
489
490 One of 'storageSource' or 'repoSource' must be provided.
491 properties:
492 repoSource:
493 description: Location of the source in a Google Cloud Source
494 Repository.
495 properties:
496 branchName:
497 description: |-
498 Regex matching branches to build. Exactly one a of branch name, tag, or commit SHA must be provided.
499 The syntax of the regular expressions accepted is the syntax accepted by RE2 and
500 described at https://github.com/google/re2/wiki/Syntax.
501 type: string
502 commitSha:
503 description: Explicit commit SHA to build. Exactly one
504 a of branch name, tag, or commit SHA must be provided.
505 type: string
506 dir:
507 description: |-
508 Directory, relative to the source root, in which to run the build.
509 This must be a relative path. If a step's dir is specified and is an absolute path,
510 this value is ignored for that step's execution.
511 type: string
512 invertRegex:
513 description: Only trigger a build if the revision regex
514 does NOT match the revision regex.
515 type: boolean
516 projectId:
517 description: |-
518 ID of the project that owns the Cloud Source Repository.
519 If omitted, the project ID requesting the build is assumed.
520 type: string
521 repoRef:
522 description: |-
523 The desired Cloud Source Repository. If omitted, "default" is
524 assumed.
525 oneOf:
526 - not:
527 required:
528 - external
529 required:
530 - name
531 - not:
532 anyOf:
533 - required:
534 - name
535 - required:
536 - namespace
537 required:
538 - external
539 properties:
540 external:
541 description: 'Allowed value: The `name` field of a
542 `SourceRepoRepository` resource.'
543 type: string
544 name:
545 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
546 type: string
547 namespace:
548 description: 'Namespace of the referent. More info:
549 https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
550 type: string
551 type: object
552 substitutions:
553 additionalProperties:
554 type: string
555 description: Substitutions to use in a triggered build.
556 Should only be used with triggers.run.
557 type: object
558 tagName:
559 description: |-
560 Regex matching tags to build. Exactly one a of branch name, tag, or commit SHA must be provided.
561 The syntax of the regular expressions accepted is the syntax accepted by RE2 and
562 described at https://github.com/google/re2/wiki/Syntax.
563 type: string
564 required:
565 - repoRef
566 type: object
567 storageSource:
568 description: Location of the source in an archive file in
569 Google Cloud Storage.
570 properties:
571 bucketRef:
572 description: Google Cloud Storage bucket containing the
573 source.
574 oneOf:
575 - not:
576 required:
577 - external
578 required:
579 - name
580 - not:
581 anyOf:
582 - required:
583 - name
584 - required:
585 - namespace
586 required:
587 - external
588 properties:
589 external:
590 description: 'Allowed value: The `name` field of a
591 `StorageBucket` resource.'
592 type: string
593 name:
594 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
595 type: string
596 namespace:
597 description: 'Namespace of the referent. More info:
598 https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
599 type: string
600 type: object
601 generation:
602 description: |-
603 Google Cloud Storage generation for the object.
604 If the generation is omitted, the latest generation will be used.
605 type: string
606 object:
607 description: |-
608 Google Cloud Storage object containing the source.
609 This object must be a gzipped archive file (.tar.gz) containing source to build.
610 type: string
611 required:
612 - bucketRef
613 - object
614 type: object
615 type: object
616 step:
617 description: The operations to be performed on the workspace.
618 items:
619 properties:
620 allowExitCodes:
621 description: |-
622 Allow this build step to fail without failing the entire build if and
623 only if the exit code is one of the specified codes.
624
625 If 'allowFailure' is also specified, this field will take precedence.
626 items:
627 type: integer
628 type: array
629 allowFailure:
630 description: |-
631 Allow this build step to fail without failing the entire build.
632 If false, the entire build will fail if this step fails. Otherwise, the
633 build will succeed, but this step will still have a failure status.
634 Error information will be reported in the 'failureDetail' field.
635
636 'allowExitCodes' takes precedence over this field.
637 type: boolean
638 args:
639 description: |-
640 A list of arguments that will be presented to the step when it is started.
641
642 If the image used to run the step's container has an entrypoint, the args
643 are used as arguments to that entrypoint. If the image does not define an
644 entrypoint, the first element in args is used as the entrypoint, and the
645 remainder will be used as arguments.
646 items:
647 type: string
648 type: array
649 dir:
650 description: |-
651 Working directory to use when running this step's container.
652
653 If this value is a relative path, it is relative to the build's working
654 directory. If this value is absolute, it may be outside the build's working
655 directory, in which case the contents of the path may not be persisted
656 across build step executions, unless a 'volume' for that path is specified.
657
658 If the build specifies a 'RepoSource' with 'dir' and a step with a
659 'dir',
660 which specifies an absolute path, the 'RepoSource' 'dir' is ignored
661 for the step's execution.
662 type: string
663 entrypoint:
664 description: |-
665 Entrypoint to be used instead of the build step image's
666 default entrypoint.
667 If unset, the image's default entrypoint is used.
668 type: string
669 env:
670 description: |-
671 A list of environment variable definitions to be used when
672 running a step.
673
674 The elements are of the form "KEY=VALUE" for the environment variable
675 "KEY" being given the value "VALUE".
676 items:
677 type: string
678 type: array
679 id:
680 description: |-
681 Unique identifier for this build step, used in 'wait_for' to
682 reference this build step as a dependency.
683 type: string
684 name:
685 description: |-
686 The name of the container image that will run this particular build step.
687
688 If the image is available in the host's Docker daemon's cache, it will be
689 run directly. If not, the host will attempt to pull the image first, using
690 the builder service account's credentials if necessary.
691
692 The Docker daemon's cache will already have the latest versions of all of
693 the officially supported build steps (see https://github.com/GoogleCloudPlatform/cloud-builders
694 for images and examples).
695 The Docker daemon will also have cached many of the layers for some popular
696 images, like "ubuntu", "debian", but they will be refreshed at the time
697 you attempt to use them.
698
699 If you built an image in a previous build step, it will be stored in the
700 host's Docker daemon's cache and is available to use as the name for a
701 later build step.
702 type: string
703 script:
704 description: |-
705 A shell script to be executed in the step.
706 When script is provided, the user cannot specify the entrypoint or args.
707 type: string
708 secretEnv:
709 description: |-
710 A list of environment variables which are encrypted using
711 a Cloud Key
712 Management Service crypto key. These values must be specified in
713 the build's 'Secret'.
714 items:
715 type: string
716 type: array
717 timeout:
718 description: |-
719 Time limit for executing this build step. If not defined,
720 the step has no
721 time limit and will be allowed to continue to run until either it
722 completes or the build itself times out.
723 type: string
724 timing:
725 description: |-
726 Output only. Stores timing information for executing this
727 build step.
728 type: string
729 volumes:
730 description: |-
731 List of volumes to mount into the build step.
732
733 Each volume is created as an empty volume prior to execution of the
734 build step. Upon completion of the build, volumes and their contents
735 are discarded.
736
737 Using a named volume in only one step is not valid as it is
738 indicative of a build request with an incorrect configuration.
739 items:
740 properties:
741 name:
742 description: |-
743 Name of the volume to mount.
744
745 Volume names must be unique per build step and must be valid names for
746 Docker volumes. Each named volume must be used by at least two build steps.
747 type: string
748 path:
749 description: |-
750 Path at which to mount the volume.
751
752 Paths must be absolute and cannot conflict with other volume paths on
753 the same build step or with certain reserved volume paths.
754 type: string
755 required:
756 - name
757 - path
758 type: object
759 type: array
760 waitFor:
761 description: |-
762 The ID(s) of the step(s) that this build step depends on.
763
764 This build step will not start until all the build steps in 'wait_for'
765 have completed successfully. If 'wait_for' is empty, this build step
766 will start when all previous build steps in the 'Build.Steps' list
767 have completed successfully.
768 items:
769 type: string
770 type: array
771 required:
772 - name
773 type: object
774 type: array
775 substitutions:
776 additionalProperties:
777 type: string
778 description: Substitutions data for Build resource.
779 type: object
780 tags:
781 description: Tags for annotation of a Build. These are not docker
782 tags.
783 items:
784 type: string
785 type: array
786 timeout:
787 description: |-
788 Amount of time that this build should be allowed to run, to second granularity.
789 If this amount of time elapses, work on the build will cease and the build status will be TIMEOUT.
790 This timeout must be equal to or greater than the sum of the timeouts for build steps within the build.
791 The expected format is the number of seconds followed by s.
792 Default time is ten minutes (600s).
793 type: string
794 required:
795 - step
796 type: object
797 description:
798 description: Human-readable description of the trigger.
799 type: string
800 disabled:
801 description: Whether the trigger is disabled or not. If true, the
802 trigger will never result in a build.
803 type: boolean
804 filename:
805 description: |-
806 Path, from the source root, to a file whose contents is used for the template.
807 Either a filename or build template must be provided. Set this only when using trigger_template or github.
808 When using Pub/Sub, Webhook or Manual set the file name using git_file_source instead.
809 type: string
810 filter:
811 description: A Common Expression Language string. Used only with Pub/Sub
812 and Webhook.
813 type: string
814 gitFileSource:
815 description: The file source describing the local or remote Build
816 template.
817 properties:
818 githubEnterpriseConfigRef:
819 description: |-
820 Only `external` field is supported to configure the reference.
821
822 The full resource name of the github enterprise config. Format:
823 projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}.
824 oneOf:
825 - not:
826 required:
827 - external
828 required:
829 - name
830 - not:
831 anyOf:
832 - required:
833 - name
834 - required:
835 - namespace
836 required:
837 - external
838 properties:
839 external:
840 description: 'Allowed value: The `name` field of a `CloudBuildGithubEnterpriseConfig`
841 resource.'
842 type: string
843 name:
844 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
845 type: string
846 namespace:
847 description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
848 type: string
849 type: object
850 path:
851 description: The path of the file, with the repo root as the root
852 of the path.
853 type: string
854 repoType:
855 description: |-
856 The type of the repo, since it may not be explicit from the repo field (e.g from a URL).
857 Values can be UNKNOWN, CLOUD_SOURCE_REPOSITORIES, GITHUB, BITBUCKET_SERVER Possible values: ["UNKNOWN", "CLOUD_SOURCE_REPOSITORIES", "GITHUB", "BITBUCKET_SERVER"].
858 type: string
859 repositoryRef:
860 description: |-
861 Only `external` field is supported to configure the reference.
862
863 The fully qualified resource name of the Repo API repository. The fully qualified resource name of the Repo API repository.
864 If unspecified, the repo from which the trigger invocation originated is assumed to be the repo from which to read the specified path.
865 oneOf:
866 - not:
867 required:
868 - external
869 required:
870 - name
871 - not:
872 anyOf:
873 - required:
874 - name
875 - required:
876 - namespace
877 required:
878 - external
879 properties:
880 external:
881 description: 'Allowed value: The `name` field of a `CloudBuildV2Repository`
882 resource.'
883 type: string
884 name:
885 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
886 type: string
887 namespace:
888 description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
889 type: string
890 type: object
891 revision:
892 description: |-
893 The branch, tag, arbitrary ref, or SHA version of the repo to use when resolving the
894 filename (optional). This field respects the same syntax/resolution as described here: https://git-scm.com/docs/gitrevisions
895 If unspecified, the revision from which the trigger invocation originated is assumed to be the revision from which to read the specified path.
896 type: string
897 uri:
898 description: |-
899 The URI of the repo (optional). If unspecified, the repo from which the trigger
900 invocation originated is assumed to be the repo from which to read the specified path.
901 type: string
902 required:
903 - path
904 - repoType
905 type: object
906 github:
907 description: |-
908 Describes the configuration of a trigger that creates a build whenever a GitHub event is received.
909
910 One of 'trigger_template', 'github', 'pubsub_config' or 'webhook_config' must be provided.
911 properties:
912 enterpriseConfigResourceNameRef:
913 description: |-
914 Only `external` field is supported to configure the reference.
915
916 The full resource name of the github enterprise config. Format:
917 projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}.
918 oneOf:
919 - not:
920 required:
921 - external
922 required:
923 - name
924 - not:
925 anyOf:
926 - required:
927 - name
928 - required:
929 - namespace
930 required:
931 - external
932 properties:
933 external:
934 description: 'Allowed value: The `name` field of a `CloudBuildGithubEnterpriseConfig`
935 resource.'
936 type: string
937 name:
938 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
939 type: string
940 namespace:
941 description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
942 type: string
943 type: object
944 name:
945 description: |-
946 Name of the repository. For example: The name for
947 https://github.com/googlecloudplatform/cloud-builders is "cloud-builders".
948 type: string
949 owner:
950 description: |-
951 Owner of the repository. For example: The owner for
952 https://github.com/googlecloudplatform/cloud-builders is "googlecloudplatform".
953 type: string
954 pullRequest:
955 description: filter to match changes in pull requests. Specify
956 only one of 'pull_request' or 'push'.
957 properties:
958 branch:
959 description: Regex of branches to match.
960 type: string
961 commentControl:
962 description: 'Whether to block builds on a "/gcbrun" comment
963 from a repository owner or collaborator. Possible values:
964 ["COMMENTS_DISABLED", "COMMENTS_ENABLED", "COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY"].'
965 type: string
966 invertRegex:
967 description: If true, branches that do NOT match the git_ref
968 will trigger a build.
969 type: boolean
970 required:
971 - branch
972 type: object
973 push:
974 description: filter to match changes in refs, like branches or
975 tags. Specify only one of 'pull_request' or 'push'.
976 properties:
977 branch:
978 description: Regex of branches to match. Specify only one
979 of branch or tag.
980 type: string
981 invertRegex:
982 description: When true, only trigger a build if the revision
983 regex does NOT match the git_ref regex.
984 type: boolean
985 tag:
986 description: Regex of tags to match. Specify only one of
987 branch or tag.
988 type: string
989 type: object
990 type: object
991 ignoredFiles:
992 description: |-
993 ignoredFiles and includedFiles are file glob matches using https://golang.org/pkg/path/filepath/#Match
994 extended with support for '**'.
995
996 If ignoredFiles and changed files are both empty, then they are not
997 used to determine whether or not to trigger a build.
998
999 If ignoredFiles is not empty, then we ignore any files that match any
1000 of the ignored_file globs. If the change has no files that are outside
1001 of the ignoredFiles globs, then we do not trigger a build.
1002 items:
1003 type: string
1004 type: array
1005 includeBuildLogs:
1006 description: |-
1007 Build logs will be sent back to GitHub as part of the checkrun
1008 result. Values can be INCLUDE_BUILD_LOGS_UNSPECIFIED or
1009 INCLUDE_BUILD_LOGS_WITH_STATUS Possible values: ["INCLUDE_BUILD_LOGS_UNSPECIFIED", "INCLUDE_BUILD_LOGS_WITH_STATUS"].
1010 type: string
1011 includedFiles:
1012 description: |-
1013 ignoredFiles and includedFiles are file glob matches using https://golang.org/pkg/path/filepath/#Match
1014 extended with support for '**'.
1015
1016 If any of the files altered in the commit pass the ignoredFiles filter
1017 and includedFiles is empty, then as far as this filter is concerned, we
1018 should trigger the build.
1019
1020 If any of the files altered in the commit pass the ignoredFiles filter
1021 and includedFiles is not empty, then we make sure that at least one of
1022 those files matches a includedFiles glob. If not, then we do not trigger
1023 a build.
1024 items:
1025 type: string
1026 type: array
1027 location:
1028 description: |-
1029 Immutable. The [Cloud Build location](https://cloud.google.com/build/docs/locations) for the trigger.
1030 If not specified, "global" is used.
1031 type: string
1032 pubsubConfig:
1033 description: |-
1034 PubsubConfig describes the configuration of a trigger that creates
1035 a build whenever a Pub/Sub message is published.
1036
1037 One of 'trigger_template', 'github', 'pubsub_config' 'webhook_config' or 'source_to_build' must be provided.
1038 properties:
1039 serviceAccountRef:
1040 description: Service account that will make the push request.
1041 oneOf:
1042 - not:
1043 required:
1044 - external
1045 required:
1046 - name
1047 - not:
1048 anyOf:
1049 - required:
1050 - name
1051 - required:
1052 - namespace
1053 required:
1054 - external
1055 properties:
1056 external:
1057 description: 'Allowed value: The `email` field of an `IAMServiceAccount`
1058 resource.'
1059 type: string
1060 name:
1061 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
1062 type: string
1063 namespace:
1064 description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
1065 type: string
1066 type: object
1067 state:
1068 description: |-
1069 Potential issues with the underlying Pub/Sub subscription configuration.
1070 Only populated on get requests.
1071 type: string
1072 subscription:
1073 description: Output only. Name of the subscription.
1074 type: string
1075 topicRef:
1076 description: |-
1077 The name of the topic from which this subscription
1078 is receiving messages.
1079 oneOf:
1080 - not:
1081 required:
1082 - external
1083 required:
1084 - name
1085 - not:
1086 anyOf:
1087 - required:
1088 - name
1089 - required:
1090 - namespace
1091 required:
1092 - external
1093 properties:
1094 external:
1095 description: 'Allowed value: string of the format `projects/{{project}}/topics/{{value}}`,
1096 where {{value}} is the `name` field of a `PubSubTopic` resource.'
1097 type: string
1098 name:
1099 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
1100 type: string
1101 namespace:
1102 description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
1103 type: string
1104 type: object
1105 required:
1106 - topicRef
1107 type: object
1108 repositoryEventConfig:
1109 description: The configuration of a trigger that creates a build whenever
1110 an event from Repo API is received.
1111 properties:
1112 pullRequest:
1113 description: Contains filter properties for matching Pull Requests.
1114 properties:
1115 branch:
1116 description: |-
1117 Regex of branches to match.
1118
1119 The syntax of the regular expressions accepted is the syntax accepted by
1120 RE2 and described at https://github.com/google/re2/wiki/Syntax.
1121 type: string
1122 commentControl:
1123 description: 'Configure builds to run whether a repository
1124 owner or collaborator need to comment ''/gcbrun''. Possible
1125 values: ["COMMENTS_DISABLED", "COMMENTS_ENABLED", "COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY"].'
1126 type: string
1127 invertRegex:
1128 description: If true, branches that do NOT match the git_ref
1129 will trigger a build.
1130 type: boolean
1131 type: object
1132 push:
1133 description: Contains filter properties for matching git pushes.
1134 properties:
1135 branch:
1136 description: |-
1137 Regex of branches to match.
1138
1139 The syntax of the regular expressions accepted is the syntax accepted by
1140 RE2 and described at https://github.com/google/re2/wiki/Syntax.
1141 type: string
1142 invertRegex:
1143 description: If true, only trigger a build if the revision
1144 regex does NOT match the git_ref regex.
1145 type: boolean
1146 tag:
1147 description: |-
1148 Regex of tags to match.
1149
1150 The syntax of the regular expressions accepted is the syntax accepted by
1151 RE2 and described at https://github.com/google/re2/wiki/Syntax.
1152 type: string
1153 type: object
1154 repository:
1155 description: The resource name of the Repo API resource.
1156 type: string
1157 type: object
1158 serviceAccountRef:
1159 description: |-
1160 The service account used for all user-controlled operations including
1161 triggers.patch, triggers.run, builds.create, and builds.cancel.
1162
1163 If no service account is set, then the standard Cloud Build service account
1164 ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead.
1165
1166 When populating via the external field, the following format is supported:
1167 projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}
1168 oneOf:
1169 - not:
1170 required:
1171 - external
1172 required:
1173 - name
1174 - not:
1175 anyOf:
1176 - required:
1177 - name
1178 - required:
1179 - namespace
1180 required:
1181 - external
1182 properties:
1183 external:
1184 description: 'Allowed value: string of the format `projects/{{project}}/serviceAccounts/{{value}}`,
1185 where {{value}} is the `email` field of an `IAMServiceAccount`
1186 resource.'
1187 type: string
1188 name:
1189 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
1190 type: string
1191 namespace:
1192 description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
1193 type: string
1194 type: object
1195 sourceToBuild:
1196 description: |-
1197 The repo and ref of the repository from which to build.
1198 This field is used only for those triggers that do not respond to SCM events.
1199 Triggers that respond to such events build source at whatever commit caused the event.
1200 This field is currently only used by Webhook, Pub/Sub, Manual, and Cron triggers.
1201
1202 One of 'trigger_template', 'github', 'pubsub_config' 'webhook_config' or 'source_to_build' must be provided.
1203 properties:
1204 githubEnterpriseConfigRef:
1205 description: |-
1206 Only `external` field is supported to configure the reference.
1207
1208 The full resource name of the github enterprise config. Format:
1209 projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}.
1210 oneOf:
1211 - not:
1212 required:
1213 - external
1214 required:
1215 - name
1216 - not:
1217 anyOf:
1218 - required:
1219 - name
1220 - required:
1221 - namespace
1222 required:
1223 - external
1224 properties:
1225 external:
1226 description: 'Allowed value: The `name` field of a `CloudBuildGithubEnterpriseConfig`
1227 resource.'
1228 type: string
1229 name:
1230 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
1231 type: string
1232 namespace:
1233 description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
1234 type: string
1235 type: object
1236 ref:
1237 description: The branch or tag to use. Must start with "refs/"
1238 (required).
1239 type: string
1240 repoType:
1241 description: |-
1242 The type of the repo, since it may not be explicit from the repo field (e.g from a URL).
1243 Values can be UNKNOWN, CLOUD_SOURCE_REPOSITORIES, GITHUB, BITBUCKET_SERVER Possible values: ["UNKNOWN", "CLOUD_SOURCE_REPOSITORIES", "GITHUB", "BITBUCKET_SERVER"].
1244 type: string
1245 repositoryRef:
1246 description: |-
1247 Only `external` field is supported to configure the reference.
1248
1249 The qualified resource name of the Repo API repository.
1250 Either uri or repository can be specified and is required.
1251 oneOf:
1252 - not:
1253 required:
1254 - external
1255 required:
1256 - name
1257 - not:
1258 anyOf:
1259 - required:
1260 - name
1261 - required:
1262 - namespace
1263 required:
1264 - external
1265 properties:
1266 external:
1267 description: 'Allowed value: The `name` field of a `CloudBuildV2Repository`
1268 resource.'
1269 type: string
1270 name:
1271 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
1272 type: string
1273 namespace:
1274 description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
1275 type: string
1276 type: object
1277 uri:
1278 description: The URI of the repo.
1279 type: string
1280 required:
1281 - ref
1282 - repoType
1283 type: object
1284 substitutions:
1285 additionalProperties:
1286 type: string
1287 description: Substitutions data for Build resource.
1288 type: object
1289 tags:
1290 description: Tags for annotation of a BuildTrigger.
1291 items:
1292 type: string
1293 type: array
1294 triggerTemplate:
1295 description: |-
1296 Template describing the types of source changes to trigger a build.
1297
1298 Branch and tag names in trigger templates are interpreted as regular
1299 expressions. Any branch or tag change that matches that regular
1300 expression will trigger a build.
1301
1302 One of 'trigger_template', 'github', 'pubsub_config', 'webhook_config' or 'source_to_build' must be provided.
1303 properties:
1304 branchName:
1305 description: |-
1306 Name of the branch to build. Exactly one a of branch name, tag, or commit SHA must be provided.
1307 This field is a regular expression.
1308 type: string
1309 commitSha:
1310 description: Explicit commit SHA to build. Exactly one of a branch
1311 name, tag, or commit SHA must be provided.
1312 type: string
1313 dir:
1314 description: |-
1315 Directory, relative to the source root, in which to run the build.
1316
1317 This must be a relative path. If a step's dir is specified and
1318 is an absolute path, this value is ignored for that step's
1319 execution.
1320 type: string
1321 invertRegex:
1322 description: Only trigger a build if the revision regex does NOT
1323 match the revision regex.
1324 type: boolean
1325 repoRef:
1326 description: |-
1327 The Cloud Source Repository to build. If omitted, the repo with
1328 name "default" is assumed.
1329 oneOf:
1330 - not:
1331 required:
1332 - external
1333 required:
1334 - name
1335 - not:
1336 anyOf:
1337 - required:
1338 - name
1339 - required:
1340 - namespace
1341 required:
1342 - external
1343 properties:
1344 external:
1345 description: 'Allowed value: The `name` field of a `SourceRepoRepository`
1346 resource.'
1347 type: string
1348 name:
1349 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
1350 type: string
1351 namespace:
1352 description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
1353 type: string
1354 type: object
1355 tagName:
1356 description: |-
1357 Name of the tag to build. Exactly one of a branch name, tag, or commit SHA must be provided.
1358 This field is a regular expression.
1359 type: string
1360 type: object
1361 webhookConfig:
1362 description: |-
1363 WebhookConfig describes the configuration of a trigger that creates
1364 a build whenever a webhook is sent to a trigger's webhook URL.
1365
1366 One of 'trigger_template', 'github', 'pubsub_config' 'webhook_config' or 'source_to_build' must be provided.
1367 properties:
1368 secretRef:
1369 description: The secret required
1370 oneOf:
1371 - not:
1372 required:
1373 - external
1374 required:
1375 - name
1376 - not:
1377 anyOf:
1378 - required:
1379 - name
1380 - required:
1381 - namespace
1382 required:
1383 - external
1384 properties:
1385 external:
1386 description: 'Allowed value: The `name` field of a `SecretManagerSecret`
1387 resource.'
1388 type: string
1389 name:
1390 description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
1391 type: string
1392 namespace:
1393 description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
1394 type: string
1395 type: object
1396 state:
1397 description: |-
1398 Potential issues with the underlying Pub/Sub subscription configuration.
1399 Only populated on get requests.
1400 type: string
1401 required:
1402 - secretRef
1403 type: object
1404 type: object
1405 status:
1406 properties:
1407 conditions:
1408 description: Conditions represent the latest available observation
1409 of the resource's current state.
1410 items:
1411 properties:
1412 lastTransitionTime:
1413 description: Last time the condition transitioned from one status
1414 to another.
1415 type: string
1416 message:
1417 description: Human-readable message indicating details about
1418 last transition.
1419 type: string
1420 reason:
1421 description: Unique, one-word, CamelCase reason for the condition's
1422 last transition.
1423 type: string
1424 status:
1425 description: Status is the status of the condition. Can be True,
1426 False, Unknown.
1427 type: string
1428 type:
1429 description: Type is the type of the condition.
1430 type: string
1431 type: object
1432 type: array
1433 createTime:
1434 description: Time when the trigger was created.
1435 type: string
1436 observedGeneration:
1437 description: ObservedGeneration is the generation of the resource
1438 that was most recently observed by the Config Connector controller.
1439 If this is equal to metadata.generation, then that means that the
1440 current reported status reflects the most recent desired state of
1441 the resource.
1442 type: integer
1443 triggerId:
1444 description: The unique identifier for the trigger.
1445 type: string
1446 type: object
1447 type: object
1448 served: true
1449 storage: true
1450 subresources:
1451 status: {}
1452status:
1453 acceptedNames:
1454 kind: ""
1455 plural: ""
1456 conditions: []
1457 storedVersions: []
View as plain text