cloudbuild.proto 78 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253
  1. // Copyright 2021 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. syntax = "proto3";
  15. package google.devtools.cloudbuild.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/httpbody.proto";
  20. import "google/api/resource.proto";
  21. import "google/longrunning/operations.proto";
  22. import "google/protobuf/duration.proto";
  23. import "google/protobuf/empty.proto";
  24. import "google/protobuf/field_mask.proto";
  25. import "google/protobuf/timestamp.proto";
  26. option csharp_namespace = "Google.Cloud.CloudBuild.V1";
  27. option go_package = "google.golang.org/genproto/googleapis/devtools/cloudbuild/v1;cloudbuild";
  28. option java_multiple_files = true;
  29. option java_package = "com.google.cloudbuild.v1";
  30. option objc_class_prefix = "GCB";
  31. option ruby_package = "Google::Cloud::Build::V1";
  32. option (google.api.resource_definition) = {
  33. type: "compute.googleapis.com/Network"
  34. pattern: "projects/{project}/global/networks/{network}"
  35. };
  36. option (google.api.resource_definition) = {
  37. type: "iam.googleapis.com/ServiceAccount"
  38. pattern: "projects/{project}/serviceAccounts/{service_account}"
  39. };
  40. option (google.api.resource_definition) = {
  41. type: "secretmanager.googleapis.com/Secret"
  42. pattern: "projects/{project}/secrets/{secret}"
  43. };
  44. option (google.api.resource_definition) = {
  45. type: "secretmanager.googleapis.com/SecretVersion"
  46. pattern: "projects/{project}/secrets/{secret}/versions/{version}"
  47. };
  48. option (google.api.resource_definition) = {
  49. type: "cloudkms.googleapis.com/CryptoKey"
  50. pattern: "projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key}"
  51. };
  52. option (google.api.resource_definition) = {
  53. type: "pubsub.googleapis.com/Subscription"
  54. pattern: "projects/{project}/subscriptions/{subscription}"
  55. };
  56. option (google.api.resource_definition) = {
  57. type: "pubsub.googleapis.com/Topic"
  58. pattern: "projects/{project}/topics/{topic}"
  59. };
  60. // Creates and manages builds on Google Cloud Platform.
  61. //
  62. // The main concept used by this API is a `Build`, which describes the location
  63. // of the source to build, how to build the source, and where to store the
  64. // built artifacts, if any.
  65. //
  66. // A user can list previously-requested builds or get builds by their ID to
  67. // determine the status of the build.
  68. service CloudBuild {
  69. option (google.api.default_host) = "cloudbuild.googleapis.com";
  70. option (google.api.oauth_scopes) =
  71. "https://www.googleapis.com/auth/cloud-platform";
  72. // Starts a build with the specified configuration.
  73. //
  74. // This method returns a long-running `Operation`, which includes the build
  75. // ID. Pass the build ID to `GetBuild` to determine the build status (such as
  76. // `SUCCESS` or `FAILURE`).
  77. rpc CreateBuild(CreateBuildRequest) returns (google.longrunning.Operation) {
  78. option (google.api.http) = {
  79. post: "/v1/projects/{project_id}/builds"
  80. body: "build"
  81. additional_bindings {
  82. post: "/v1/{parent=projects/*/locations/*}/builds"
  83. body: "build"
  84. }
  85. };
  86. option (google.api.method_signature) = "project_id,build";
  87. option (google.longrunning.operation_info) = {
  88. response_type: "Build"
  89. metadata_type: "BuildOperationMetadata"
  90. };
  91. }
  92. // Returns information about a previously requested build.
  93. //
  94. // The `Build` that is returned includes its status (such as `SUCCESS`,
  95. // `FAILURE`, or `WORKING`), and timing information.
  96. rpc GetBuild(GetBuildRequest) returns (Build) {
  97. option (google.api.http) = {
  98. get: "/v1/projects/{project_id}/builds/{id}"
  99. additional_bindings { get: "/v1/{name=projects/*/locations/*/builds/*}" }
  100. };
  101. option (google.api.method_signature) = "project_id,id";
  102. }
  103. // Lists previously requested builds.
  104. //
  105. // Previously requested builds may still be in-progress, or may have finished
  106. // successfully or unsuccessfully.
  107. rpc ListBuilds(ListBuildsRequest) returns (ListBuildsResponse) {
  108. option (google.api.http) = {
  109. get: "/v1/projects/{project_id}/builds"
  110. additional_bindings { get: "/v1/{parent=projects/*/locations/*}/builds" }
  111. };
  112. option (google.api.method_signature) = "project_id,filter";
  113. }
  114. // Cancels a build in progress.
  115. rpc CancelBuild(CancelBuildRequest) returns (Build) {
  116. option (google.api.http) = {
  117. post: "/v1/projects/{project_id}/builds/{id}:cancel"
  118. body: "*"
  119. additional_bindings {
  120. post: "/v1/{name=projects/*/locations/*/builds/*}:cancel"
  121. body: "*"
  122. }
  123. };
  124. option (google.api.method_signature) = "project_id,id";
  125. }
  126. // Creates a new build based on the specified build.
  127. //
  128. // This method creates a new build using the original build request, which may
  129. // or may not result in an identical build.
  130. //
  131. // For triggered builds:
  132. //
  133. // * Triggered builds resolve to a precise revision; therefore a retry of a
  134. // triggered build will result in a build that uses the same revision.
  135. //
  136. // For non-triggered builds that specify `RepoSource`:
  137. //
  138. // * If the original build built from the tip of a branch, the retried build
  139. // will build from the tip of that branch, which may not be the same revision
  140. // as the original build.
  141. // * If the original build specified a commit sha or revision ID, the retried
  142. // build will use the identical source.
  143. //
  144. // For builds that specify `StorageSource`:
  145. //
  146. // * If the original build pulled source from Google Cloud Storage without
  147. // specifying the generation of the object, the new build will use the current
  148. // object, which may be different from the original build source.
  149. // * If the original build pulled source from Cloud Storage and specified the
  150. // generation of the object, the new build will attempt to use the same
  151. // object, which may or may not be available depending on the bucket's
  152. // lifecycle management settings.
  153. rpc RetryBuild(RetryBuildRequest) returns (google.longrunning.Operation) {
  154. option (google.api.http) = {
  155. post: "/v1/projects/{project_id}/builds/{id}:retry"
  156. body: "*"
  157. additional_bindings {
  158. post: "/v1/{name=projects/*/locations/*/builds/*}:retry"
  159. body: "*"
  160. }
  161. };
  162. option (google.api.method_signature) = "project_id,id";
  163. option (google.longrunning.operation_info) = {
  164. response_type: "Build"
  165. metadata_type: "BuildOperationMetadata"
  166. };
  167. }
  168. // Approves or rejects a pending build.
  169. //
  170. // If approved, the returned LRO will be analogous to the LRO returned from
  171. // a CreateBuild call.
  172. //
  173. // If rejected, the returned LRO will be immediately done.
  174. rpc ApproveBuild(ApproveBuildRequest) returns (google.longrunning.Operation) {
  175. option (google.api.http) = {
  176. post: "/v1/{name=projects/*/builds/*}:approve"
  177. body: "*"
  178. additional_bindings {
  179. post: "/v1/{name=projects/*/locations/*/builds/*}:approve"
  180. body: "*"
  181. }
  182. };
  183. option (google.api.method_signature) = "name,approval_result";
  184. option (google.longrunning.operation_info) = {
  185. response_type: "Build"
  186. metadata_type: "BuildOperationMetadata"
  187. };
  188. }
  189. // Creates a new `BuildTrigger`.
  190. //
  191. // This API is experimental.
  192. rpc CreateBuildTrigger(CreateBuildTriggerRequest) returns (BuildTrigger) {
  193. option (google.api.http) = {
  194. post: "/v1/projects/{project_id}/triggers"
  195. body: "trigger"
  196. additional_bindings {
  197. post: "/v1/{parent=projects/*/locations/*}/triggers"
  198. body: "trigger"
  199. }
  200. };
  201. option (google.api.method_signature) = "project_id,trigger";
  202. }
  203. // Returns information about a `BuildTrigger`.
  204. //
  205. // This API is experimental.
  206. rpc GetBuildTrigger(GetBuildTriggerRequest) returns (BuildTrigger) {
  207. option (google.api.http) = {
  208. get: "/v1/projects/{project_id}/triggers/{trigger_id}"
  209. additional_bindings {
  210. get: "/v1/{name=projects/*/locations/*/triggers/*}"
  211. }
  212. };
  213. option (google.api.method_signature) = "project_id,trigger_id";
  214. }
  215. // Lists existing `BuildTrigger`s.
  216. //
  217. // This API is experimental.
  218. rpc ListBuildTriggers(ListBuildTriggersRequest)
  219. returns (ListBuildTriggersResponse) {
  220. option (google.api.http) = {
  221. get: "/v1/projects/{project_id}/triggers"
  222. additional_bindings {
  223. get: "/v1/{parent=projects/*/locations/*}/triggers"
  224. }
  225. };
  226. option (google.api.method_signature) = "project_id";
  227. }
  228. // Deletes a `BuildTrigger` by its project ID and trigger ID.
  229. //
  230. // This API is experimental.
  231. rpc DeleteBuildTrigger(DeleteBuildTriggerRequest)
  232. returns (google.protobuf.Empty) {
  233. option (google.api.http) = {
  234. delete: "/v1/projects/{project_id}/triggers/{trigger_id}"
  235. additional_bindings {
  236. delete: "/v1/{name=projects/*/locations/*/triggers/*}"
  237. }
  238. };
  239. option (google.api.method_signature) = "project_id,trigger_id";
  240. }
  241. // Updates a `BuildTrigger` by its project ID and trigger ID.
  242. //
  243. // This API is experimental.
  244. rpc UpdateBuildTrigger(UpdateBuildTriggerRequest) returns (BuildTrigger) {
  245. option (google.api.http) = {
  246. patch: "/v1/projects/{project_id}/triggers/{trigger_id}"
  247. body: "trigger"
  248. additional_bindings {
  249. patch: "/v1/{trigger.resource_name=projects/*/locations/*/triggers/*}"
  250. body: "trigger"
  251. }
  252. };
  253. option (google.api.method_signature) = "project_id,trigger_id,trigger";
  254. }
  255. // Runs a `BuildTrigger` at a particular source revision.
  256. rpc RunBuildTrigger(RunBuildTriggerRequest)
  257. returns (google.longrunning.Operation) {
  258. option (google.api.http) = {
  259. post: "/v1/projects/{project_id}/triggers/{trigger_id}:run"
  260. body: "source"
  261. additional_bindings {
  262. post: "/v1/{name=projects/*/locations/*/triggers/*}:run"
  263. body: "*"
  264. }
  265. };
  266. option (google.api.method_signature) = "project_id,trigger_id,source";
  267. option (google.longrunning.operation_info) = {
  268. response_type: "Build"
  269. metadata_type: "BuildOperationMetadata"
  270. };
  271. }
  272. // ReceiveTriggerWebhook [Experimental] is called when the API receives a
  273. // webhook request targeted at a specific trigger.
  274. rpc ReceiveTriggerWebhook(ReceiveTriggerWebhookRequest)
  275. returns (ReceiveTriggerWebhookResponse) {
  276. option (google.api.http) = {
  277. post: "/v1/projects/{project_id}/triggers/{trigger}:webhook"
  278. body: "body"
  279. additional_bindings {
  280. post: "/v1/{name=projects/*/locations/*/triggers/*}:webhook"
  281. body: "body"
  282. }
  283. };
  284. }
  285. // Creates a `WorkerPool`.
  286. rpc CreateWorkerPool(CreateWorkerPoolRequest)
  287. returns (google.longrunning.Operation) {
  288. option (google.api.http) = {
  289. post: "/v1/{parent=projects/*/locations/*}/workerPools"
  290. body: "worker_pool"
  291. };
  292. option (google.api.method_signature) = "parent,worker_pool,worker_pool_id";
  293. option (google.longrunning.operation_info) = {
  294. response_type: "WorkerPool"
  295. metadata_type: "CreateWorkerPoolOperationMetadata"
  296. };
  297. }
  298. // Returns details of a `WorkerPool`.
  299. rpc GetWorkerPool(GetWorkerPoolRequest) returns (WorkerPool) {
  300. option (google.api.http) = {
  301. get: "/v1/{name=projects/*/locations/*/workerPools/*}"
  302. };
  303. option (google.api.method_signature) = "name";
  304. }
  305. // Deletes a `WorkerPool`.
  306. rpc DeleteWorkerPool(DeleteWorkerPoolRequest)
  307. returns (google.longrunning.Operation) {
  308. option (google.api.http) = {
  309. delete: "/v1/{name=projects/*/locations/*/workerPools/*}"
  310. };
  311. option (google.api.method_signature) = "name";
  312. option (google.longrunning.operation_info) = {
  313. response_type: "google.protobuf.Empty"
  314. metadata_type: "DeleteWorkerPoolOperationMetadata"
  315. };
  316. }
  317. // Updates a `WorkerPool`.
  318. rpc UpdateWorkerPool(UpdateWorkerPoolRequest)
  319. returns (google.longrunning.Operation) {
  320. option (google.api.http) = {
  321. patch: "/v1/{worker_pool.name=projects/*/locations/*/workerPools/*}"
  322. body: "worker_pool"
  323. };
  324. option (google.api.method_signature) = "worker_pool,update_mask";
  325. option (google.longrunning.operation_info) = {
  326. response_type: "WorkerPool"
  327. metadata_type: "UpdateWorkerPoolOperationMetadata"
  328. };
  329. }
  330. // Lists `WorkerPool`s.
  331. rpc ListWorkerPools(ListWorkerPoolsRequest)
  332. returns (ListWorkerPoolsResponse) {
  333. option (google.api.http) = {
  334. get: "/v1/{parent=projects/*/locations/*}/workerPools"
  335. };
  336. option (google.api.method_signature) = "parent";
  337. }
  338. }
  339. // Specifies a build to retry.
  340. message RetryBuildRequest {
  341. // The name of the `Build` to retry.
  342. // Format: `projects/{project}/locations/{location}/builds/{build}`
  343. string name = 3 [(google.api.resource_reference) = {
  344. type: "cloudbuild.googleapis.com/Build"
  345. }];
  346. // Required. ID of the project.
  347. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  348. // Required. Build ID of the original build.
  349. string id = 2 [(google.api.field_behavior) = REQUIRED];
  350. }
  351. // Specifies a build trigger to run and the source to use.
  352. message RunBuildTriggerRequest {
  353. // The name of the `Trigger` to run.
  354. // Format: `projects/{project}/locations/{location}/triggers/{trigger}`
  355. string name = 4 [(google.api.resource_reference) = {
  356. type: "cloudbuild.googleapis.com/BuildTrigger"
  357. }];
  358. // Required. ID of the project.
  359. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  360. // Required. ID of the trigger.
  361. string trigger_id = 2 [(google.api.field_behavior) = REQUIRED];
  362. // Source to build against this trigger.
  363. RepoSource source = 3;
  364. }
  365. // Location of the source in an archive file in Google Cloud Storage.
  366. message StorageSource {
  367. // Google Cloud Storage bucket containing the source (see
  368. // [Bucket Name
  369. // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
  370. string bucket = 1;
  371. // Google Cloud Storage object containing the source.
  372. //
  373. // This object must be a gzipped archive file (`.tar.gz`) containing source to
  374. // build.
  375. string object = 2;
  376. // Google Cloud Storage generation for the object. If the generation is
  377. // omitted, the latest generation will be used.
  378. int64 generation = 3;
  379. }
  380. // Location of the source in a Google Cloud Source Repository.
  381. message RepoSource {
  382. // ID of the project that owns the Cloud Source Repository. If omitted, the
  383. // project ID requesting the build is assumed.
  384. string project_id = 1;
  385. // Name of the Cloud Source Repository.
  386. string repo_name = 2;
  387. // A revision within the Cloud Source Repository must be specified in
  388. // one of these ways.
  389. oneof revision {
  390. // Regex matching branches to build.
  391. //
  392. // The syntax of the regular expressions accepted is the syntax accepted by
  393. // RE2 and described at https://github.com/google/re2/wiki/Syntax
  394. string branch_name = 3;
  395. // Regex matching tags to build.
  396. //
  397. // The syntax of the regular expressions accepted is the syntax accepted by
  398. // RE2 and described at https://github.com/google/re2/wiki/Syntax
  399. string tag_name = 4;
  400. // Explicit commit SHA to build.
  401. string commit_sha = 5;
  402. }
  403. // Directory, relative to the source root, in which to run the build.
  404. //
  405. // This must be a relative path. If a step's `dir` is specified and is an
  406. // absolute path, this value is ignored for that step's execution.
  407. string dir = 7;
  408. // Only trigger a build if the revision regex does NOT match the revision
  409. // regex.
  410. bool invert_regex = 8;
  411. // Substitutions to use in a triggered build.
  412. // Should only be used with RunBuildTrigger
  413. map<string, string> substitutions = 9;
  414. }
  415. // Location of the source manifest in Google Cloud Storage.
  416. // This feature is in Preview; see description
  417. // [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher).
  418. message StorageSourceManifest {
  419. // Google Cloud Storage bucket containing the source manifest (see [Bucket
  420. // Name
  421. // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
  422. string bucket = 1;
  423. // Google Cloud Storage object containing the source manifest.
  424. //
  425. // This object must be a JSON file.
  426. string object = 2;
  427. // Google Cloud Storage generation for the object. If the generation is
  428. // omitted, the latest generation will be used.
  429. int64 generation = 3;
  430. }
  431. // Location of the source in a supported storage service.
  432. message Source {
  433. // Location of source.
  434. oneof source {
  435. // If provided, get the source from this location in Google Cloud Storage.
  436. StorageSource storage_source = 2;
  437. // If provided, get the source from this location in a Cloud Source
  438. // Repository.
  439. RepoSource repo_source = 3;
  440. // If provided, get the source from this manifest in Google Cloud Storage.
  441. // This feature is in Preview; see description
  442. // [here](https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher).
  443. StorageSourceManifest storage_source_manifest = 8;
  444. }
  445. }
  446. // An image built by the pipeline.
  447. message BuiltImage {
  448. // Name used to push the container image to Google Container Registry, as
  449. // presented to `docker push`.
  450. string name = 1;
  451. // Docker Registry 2.0 digest.
  452. string digest = 3;
  453. // Output only. Stores timing information for pushing the specified image.
  454. TimeSpan push_timing = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
  455. }
  456. // Artifact uploaded using the PythonPackage directive.
  457. message UploadedPythonPackage {
  458. // URI of the uploaded artifact.
  459. string uri = 1;
  460. // Hash types and values of the Python Artifact.
  461. FileHashes file_hashes = 2;
  462. // Output only. Stores timing information for pushing the specified artifact.
  463. TimeSpan push_timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  464. }
  465. // A Maven artifact uploaded using the MavenArtifact directive.
  466. message UploadedMavenArtifact {
  467. // URI of the uploaded artifact.
  468. string uri = 1;
  469. // Hash types and values of the Maven Artifact.
  470. FileHashes file_hashes = 2;
  471. // Output only. Stores timing information for pushing the specified artifact.
  472. TimeSpan push_timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  473. }
  474. // A step in the build pipeline.
  475. message BuildStep {
  476. // Required. The name of the container image that will run this particular
  477. // build step.
  478. //
  479. // If the image is available in the host's Docker daemon's cache, it
  480. // will be run directly. If not, the host will attempt to pull the image
  481. // first, using the builder service account's credentials if necessary.
  482. //
  483. // The Docker daemon's cache will already have the latest versions of all of
  484. // the officially supported build steps
  485. // ([https://github.com/GoogleCloudPlatform/cloud-builders](https://github.com/GoogleCloudPlatform/cloud-builders)).
  486. // The Docker daemon will also have cached many of the layers for some popular
  487. // images, like "ubuntu", "debian", but they will be refreshed at the time you
  488. // attempt to use them.
  489. //
  490. // If you built an image in a previous build step, it will be stored in the
  491. // host's Docker daemon's cache and is available to use as the name for a
  492. // later build step.
  493. string name = 1;
  494. // A list of environment variable definitions to be used when running a step.
  495. //
  496. // The elements are of the form "KEY=VALUE" for the environment variable "KEY"
  497. // being given the value "VALUE".
  498. repeated string env = 2;
  499. // A list of arguments that will be presented to the step when it is started.
  500. //
  501. // If the image used to run the step's container has an entrypoint, the `args`
  502. // are used as arguments to that entrypoint. If the image does not define
  503. // an entrypoint, the first element in args is used as the entrypoint,
  504. // and the remainder will be used as arguments.
  505. repeated string args = 3;
  506. // Working directory to use when running this step's container.
  507. //
  508. // If this value is a relative path, it is relative to the build's working
  509. // directory. If this value is absolute, it may be outside the build's working
  510. // directory, in which case the contents of the path may not be persisted
  511. // across build step executions, unless a `volume` for that path is specified.
  512. //
  513. // If the build specifies a `RepoSource` with `dir` and a step with a `dir`,
  514. // which specifies an absolute path, the `RepoSource` `dir` is ignored for
  515. // the step's execution.
  516. string dir = 4;
  517. // Unique identifier for this build step, used in `wait_for` to
  518. // reference this build step as a dependency.
  519. string id = 5;
  520. // The ID(s) of the step(s) that this build step depends on.
  521. // This build step will not start until all the build steps in `wait_for`
  522. // have completed successfully. If `wait_for` is empty, this build step will
  523. // start when all previous build steps in the `Build.Steps` list have
  524. // completed successfully.
  525. repeated string wait_for = 6;
  526. // Entrypoint to be used instead of the build step image's default entrypoint.
  527. // If unset, the image's default entrypoint is used.
  528. string entrypoint = 7;
  529. // A list of environment variables which are encrypted using a Cloud Key
  530. // Management Service crypto key. These values must be specified in the
  531. // build's `Secret`.
  532. repeated string secret_env = 8;
  533. // List of volumes to mount into the build step.
  534. //
  535. // Each volume is created as an empty volume prior to execution of the
  536. // build step. Upon completion of the build, volumes and their contents are
  537. // discarded.
  538. //
  539. // Using a named volume in only one step is not valid as it is indicative
  540. // of a build request with an incorrect configuration.
  541. repeated Volume volumes = 9;
  542. // Output only. Stores timing information for executing this build step.
  543. TimeSpan timing = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  544. // Output only. Stores timing information for pulling this build step's
  545. // builder image only.
  546. TimeSpan pull_timing = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  547. // Time limit for executing this build step. If not defined, the step has no
  548. // time limit and will be allowed to continue to run until either it completes
  549. // or the build itself times out.
  550. google.protobuf.Duration timeout = 11;
  551. // Output only. Status of the build step. At this time, build step status is
  552. // only updated on build completion; step status is not updated in real-time
  553. // as the build progresses.
  554. Build.Status status = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  555. // Allow this build step to fail without failing the entire build.
  556. //
  557. // If false, the entire build will fail if this step fails. Otherwise, the
  558. // build will succeed, but this step will still have a failure status.
  559. // Error information will be reported in the failure_detail field.
  560. bool allow_failure = 14;
  561. // Output only. Return code from running the step.
  562. int32 exit_code = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
  563. // Allow this build step to fail without failing the entire build if and
  564. // only if the exit code is one of the specified codes. If allow_failure
  565. // is also specified, this field will take precedence.
  566. repeated int32 allow_exit_codes = 18;
  567. // A shell script to be executed in the step.
  568. //
  569. // When script is provided, the user cannot specify the entrypoint or args.
  570. string script = 19;
  571. }
  572. // Volume describes a Docker container volume which is mounted into build steps
  573. // in order to persist files across build step execution.
  574. message Volume {
  575. // Name of the volume to mount.
  576. //
  577. // Volume names must be unique per build step and must be valid names for
  578. // Docker volumes. Each named volume must be used by at least two build steps.
  579. string name = 1;
  580. // Path at which to mount the volume.
  581. //
  582. // Paths must be absolute and cannot conflict with other volume paths on the
  583. // same build step or with certain reserved volume paths.
  584. string path = 2;
  585. }
  586. // Artifacts created by the build pipeline.
  587. message Results {
  588. // Container images that were built as a part of the build.
  589. repeated BuiltImage images = 2;
  590. // List of build step digests, in the order corresponding to build step
  591. // indices.
  592. repeated string build_step_images = 3;
  593. // Path to the artifact manifest. Only populated when artifacts are uploaded.
  594. string artifact_manifest = 4;
  595. // Number of artifacts uploaded. Only populated when artifacts are uploaded.
  596. int64 num_artifacts = 5;
  597. // List of build step outputs, produced by builder images, in the order
  598. // corresponding to build step indices.
  599. //
  600. // [Cloud Builders](https://cloud.google.com/cloud-build/docs/cloud-builders)
  601. // can produce this output by writing to `$BUILDER_OUTPUT/output`.
  602. // Only the first 4KB of data is stored.
  603. repeated bytes build_step_outputs = 6;
  604. // Time to push all non-container artifacts.
  605. TimeSpan artifact_timing = 7;
  606. // Python artifacts uploaded to Artifact Registry at the end of the build.
  607. repeated UploadedPythonPackage python_packages = 8;
  608. // Maven artifacts uploaded to Artifact Registry at the end of the build.
  609. repeated UploadedMavenArtifact maven_artifacts = 9;
  610. }
  611. // An artifact that was uploaded during a build. This
  612. // is a single record in the artifact manifest JSON file.
  613. message ArtifactResult {
  614. // The path of an artifact in a Google Cloud Storage bucket, with the
  615. // generation number. For example,
  616. // `gs://mybucket/path/to/output.jar#generation`.
  617. string location = 1;
  618. // The file hash of the artifact.
  619. repeated FileHashes file_hash = 2;
  620. }
  621. // A build resource in the Cloud Build API.
  622. //
  623. // At a high level, a `Build` describes where to find source code, how to build
  624. // it (for example, the builder image to run on the source), and where to store
  625. // the built artifacts.
  626. //
  627. // Fields can include the following variables, which will be expanded when the
  628. // build is created:
  629. //
  630. // - $PROJECT_ID: the project ID of the build.
  631. // - $PROJECT_NUMBER: the project number of the build.
  632. // - $BUILD_ID: the autogenerated ID of the build.
  633. // - $REPO_NAME: the source repository name specified by RepoSource.
  634. // - $BRANCH_NAME: the branch name specified by RepoSource.
  635. // - $TAG_NAME: the tag name specified by RepoSource.
  636. // - $REVISION_ID or $COMMIT_SHA: the commit SHA specified by RepoSource or
  637. // resolved from the specified branch or tag.
  638. // - $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA.
  639. message Build {
  640. option (google.api.resource) = {
  641. type: "cloudbuild.googleapis.com/Build"
  642. pattern: "projects/{project}/builds/{build}"
  643. pattern: "projects/{project}/locations/{location}/builds/{build}"
  644. };
  645. // A non-fatal problem encountered during the execution of the build.
  646. message Warning {
  647. // The relative importance of this warning.
  648. enum Priority {
  649. // Should not be used.
  650. PRIORITY_UNSPECIFIED = 0;
  651. // e.g. deprecation warnings and alternative feature highlights.
  652. INFO = 1;
  653. // e.g. automated detection of possible issues with the build.
  654. WARNING = 2;
  655. // e.g. alerts that a feature used in the build is pending removal
  656. ALERT = 3;
  657. }
  658. // Explanation of the warning generated.
  659. string text = 1;
  660. // The priority for this warning.
  661. Priority priority = 2;
  662. }
  663. // A fatal problem encountered during the execution of the build.
  664. message FailureInfo {
  665. // The name of a fatal problem encountered during the execution of the
  666. // build.
  667. enum FailureType {
  668. // Type unspecified
  669. FAILURE_TYPE_UNSPECIFIED = 0;
  670. // Unable to push the image to the repository.
  671. PUSH_FAILED = 1;
  672. // Final image not found.
  673. PUSH_IMAGE_NOT_FOUND = 2;
  674. // Unauthorized push of the final image.
  675. PUSH_NOT_AUTHORIZED = 3;
  676. // Backend logging failures. Should retry.
  677. LOGGING_FAILURE = 4;
  678. // A build step has failed.
  679. USER_BUILD_STEP = 5;
  680. // The source fetching has failed.
  681. FETCH_SOURCE_FAILED = 6;
  682. }
  683. // The name of the failure.
  684. FailureType type = 1;
  685. // Explains the failure issue in more detail using hard-coded text.
  686. string detail = 2;
  687. }
  688. // Possible status of a build or build step.
  689. enum Status {
  690. // Status of the build is unknown.
  691. STATUS_UNKNOWN = 0;
  692. // Build has been created and is pending execution and queuing. It has not
  693. // been queued.
  694. PENDING = 10;
  695. // Build or step is queued; work has not yet begun.
  696. QUEUED = 1;
  697. // Build or step is being executed.
  698. WORKING = 2;
  699. // Build or step finished successfully.
  700. SUCCESS = 3;
  701. // Build or step failed to complete successfully.
  702. FAILURE = 4;
  703. // Build or step failed due to an internal cause.
  704. INTERNAL_ERROR = 5;
  705. // Build or step took longer than was allowed.
  706. TIMEOUT = 6;
  707. // Build or step was canceled by a user.
  708. CANCELLED = 7;
  709. // Build was enqueued for longer than the value of `queue_ttl`.
  710. EXPIRED = 9;
  711. }
  712. // Output only. The 'Build' name with format:
  713. // `projects/{project}/locations/{location}/builds/{build}`, where {build}
  714. // is a unique identifier generated by the service.
  715. string name = 45 [(google.api.field_behavior) = OUTPUT_ONLY];
  716. // Output only. Unique identifier of the build.
  717. string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  718. // Output only. ID of the project.
  719. string project_id = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
  720. // Output only. Status of the build.
  721. Status status = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  722. // Output only. Customer-readable message about the current status.
  723. string status_detail = 24 [(google.api.field_behavior) = OUTPUT_ONLY];
  724. // The location of the source files to build.
  725. Source source = 3;
  726. // Required. The operations to be performed on the workspace.
  727. repeated BuildStep steps = 11;
  728. // Output only. Results of the build.
  729. Results results = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  730. // Output only. Time at which the request to create the build was received.
  731. google.protobuf.Timestamp create_time = 6
  732. [(google.api.field_behavior) = OUTPUT_ONLY];
  733. // Output only. Time at which execution of the build was started.
  734. google.protobuf.Timestamp start_time = 7
  735. [(google.api.field_behavior) = OUTPUT_ONLY];
  736. // Output only. Time at which execution of the build was finished.
  737. //
  738. // The difference between finish_time and start_time is the duration of the
  739. // build's execution.
  740. google.protobuf.Timestamp finish_time = 8
  741. [(google.api.field_behavior) = OUTPUT_ONLY];
  742. // Amount of time that this build should be allowed to run, to second
  743. // granularity. If this amount of time elapses, work on the build will cease
  744. // and the build status will be `TIMEOUT`.
  745. //
  746. // `timeout` starts ticking from `startTime`.
  747. //
  748. // Default time is ten minutes.
  749. google.protobuf.Duration timeout = 12;
  750. // A list of images to be pushed upon the successful completion of all build
  751. // steps.
  752. //
  753. // The images are pushed using the builder service account's credentials.
  754. //
  755. // The digests of the pushed images will be stored in the `Build` resource's
  756. // results field.
  757. //
  758. // If any of the images fail to be pushed, the build status is marked
  759. // `FAILURE`.
  760. repeated string images = 13;
  761. // TTL in queue for this build. If provided and the build is enqueued longer
  762. // than this value, the build will expire and the build status will be
  763. // `EXPIRED`.
  764. //
  765. // The TTL starts ticking from create_time.
  766. google.protobuf.Duration queue_ttl = 40;
  767. // Artifacts produced by the build that should be uploaded upon
  768. // successful completion of all build steps.
  769. Artifacts artifacts = 37;
  770. // Google Cloud Storage bucket where logs should be written (see
  771. // [Bucket Name
  772. // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
  773. // Logs file names will be of the format `${logs_bucket}/log-${build_id}.txt`.
  774. string logs_bucket = 19;
  775. // Output only. A permanent fixed identifier for source.
  776. SourceProvenance source_provenance = 21
  777. [(google.api.field_behavior) = OUTPUT_ONLY];
  778. // Output only. The ID of the `BuildTrigger` that triggered this build, if it
  779. // was triggered automatically.
  780. string build_trigger_id = 22 [(google.api.field_behavior) = OUTPUT_ONLY];
  781. // Special options for this build.
  782. BuildOptions options = 23;
  783. // Output only. URL to logs for this build in Google Cloud Console.
  784. string log_url = 25 [(google.api.field_behavior) = OUTPUT_ONLY];
  785. // Substitutions data for `Build` resource.
  786. map<string, string> substitutions = 29;
  787. // Tags for annotation of a `Build`. These are not docker tags.
  788. repeated string tags = 31;
  789. // Secrets to decrypt using Cloud Key Management Service.
  790. // Note: Secret Manager is the recommended technique
  791. // for managing sensitive data with Cloud Build. Use `available_secrets` to
  792. // configure builds to access secrets from Secret Manager. For instructions,
  793. // see: https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets
  794. repeated Secret secrets = 32;
  795. // Output only. Stores timing information for phases of the build. Valid keys
  796. // are:
  797. //
  798. // * BUILD: time to execute all build steps.
  799. // * PUSH: time to push all specified images.
  800. // * FETCHSOURCE: time to fetch source.
  801. // * SETUPBUILD: time to set up build.
  802. //
  803. // If the build does not specify source or images,
  804. // these keys will not be included.
  805. map<string, TimeSpan> timing = 33 [(google.api.field_behavior) = OUTPUT_ONLY];
  806. // Output only. Describes this build's approval configuration, status,
  807. // and result.
  808. BuildApproval approval = 44 [(google.api.field_behavior) = OUTPUT_ONLY];
  809. // IAM service account whose credentials will be used at build runtime.
  810. // Must be of the format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`.
  811. // ACCOUNT can be email address or uniqueId of the service account.
  812. //
  813. string service_account = 42 [(google.api.resource_reference) = {
  814. type: "iam.googleapis.com/ServiceAccount"
  815. }];
  816. // Secrets and secret environment variables.
  817. Secrets available_secrets = 47;
  818. // Output only. Non-fatal problems encountered during the execution of the
  819. // build.
  820. repeated Warning warnings = 49 [(google.api.field_behavior) = OUTPUT_ONLY];
  821. // Output only. Contains information about the build when status=FAILURE.
  822. FailureInfo failure_info = 51 [(google.api.field_behavior) = OUTPUT_ONLY];
  823. }
  824. // Artifacts produced by a build that should be uploaded upon
  825. // successful completion of all build steps.
  826. message Artifacts {
  827. // Files in the workspace to upload to Cloud Storage upon successful
  828. // completion of all build steps.
  829. message ArtifactObjects {
  830. // Cloud Storage bucket and optional object path, in the form
  831. // "gs://bucket/path/to/somewhere/". (see [Bucket Name
  832. // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
  833. //
  834. // Files in the workspace matching any path pattern will be uploaded to
  835. // Cloud Storage with this location as a prefix.
  836. string location = 1;
  837. // Path globs used to match files in the build's workspace.
  838. repeated string paths = 2;
  839. // Output only. Stores timing information for pushing all artifact objects.
  840. TimeSpan timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  841. }
  842. // A Maven artifact to upload to Artifact Registry upon successful completion
  843. // of all build steps.
  844. message MavenArtifact {
  845. // Artifact Registry repository, in the form
  846. // "https://$REGION-maven.pkg.dev/$PROJECT/$REPOSITORY"
  847. //
  848. // Artifact in the workspace specified by path will be uploaded to
  849. // Artifact Registry with this location as a prefix.
  850. string repository = 1;
  851. // Path to an artifact in the build's workspace to be uploaded to
  852. // Artifact Registry.
  853. // This can be either an absolute path,
  854. // e.g. /workspace/my-app/target/my-app-1.0.SNAPSHOT.jar
  855. // or a relative path from /workspace,
  856. // e.g. my-app/target/my-app-1.0.SNAPSHOT.jar.
  857. string path = 2;
  858. // Maven `artifactId` value used when uploading the artifact to Artifact
  859. // Registry.
  860. string artifact_id = 3;
  861. // Maven `groupId` value used when uploading the artifact to Artifact
  862. // Registry.
  863. string group_id = 4;
  864. // Maven `version` value used when uploading the artifact to Artifact
  865. // Registry.
  866. string version = 5;
  867. }
  868. // Python package to upload to Artifact Registry upon successful completion
  869. // of all build steps. A package can encapsulate multiple objects to be
  870. // uploaded to a single repository.
  871. message PythonPackage {
  872. // Artifact Registry repository, in the form
  873. // "https://$REGION-python.pkg.dev/$PROJECT/$REPOSITORY"
  874. //
  875. // Files in the workspace matching any path pattern will be uploaded to
  876. // Artifact Registry with this location as a prefix.
  877. string repository = 1;
  878. // Path globs used to match files in the build's workspace. For Python/
  879. // Twine, this is usually `dist/*`, and sometimes additionally an `.asc`
  880. // file.
  881. repeated string paths = 2;
  882. }
  883. // A list of images to be pushed upon the successful completion of all build
  884. // steps.
  885. //
  886. // The images will be pushed using the builder service account's credentials.
  887. //
  888. // The digests of the pushed images will be stored in the Build resource's
  889. // results field.
  890. //
  891. // If any of the images fail to be pushed, the build is marked FAILURE.
  892. repeated string images = 1;
  893. // A list of objects to be uploaded to Cloud Storage upon successful
  894. // completion of all build steps.
  895. //
  896. // Files in the workspace matching specified paths globs will be uploaded to
  897. // the specified Cloud Storage location using the builder service account's
  898. // credentials.
  899. //
  900. // The location and generation of the uploaded objects will be stored in the
  901. // Build resource's results field.
  902. //
  903. // If any objects fail to be pushed, the build is marked FAILURE.
  904. ArtifactObjects objects = 2;
  905. // A list of Maven artifacts to be uploaded to Artifact Registry upon
  906. // successful completion of all build steps.
  907. //
  908. // Artifacts in the workspace matching specified paths globs will be uploaded
  909. // to the specified Artifact Registry repository using the builder service
  910. // account's credentials.
  911. //
  912. // If any artifacts fail to be pushed, the build is marked FAILURE.
  913. repeated MavenArtifact maven_artifacts = 3;
  914. // A list of Python packages to be uploaded to Artifact Registry upon
  915. // successful completion of all build steps.
  916. //
  917. // The build service account credentials will be used to perform the upload.
  918. //
  919. // If any objects fail to be pushed, the build is marked FAILURE.
  920. repeated PythonPackage python_packages = 5;
  921. }
  922. // Start and end times for a build execution phase.
  923. message TimeSpan {
  924. // Start of time span.
  925. google.protobuf.Timestamp start_time = 1;
  926. // End of time span.
  927. google.protobuf.Timestamp end_time = 2;
  928. }
  929. // Metadata for build operations.
  930. message BuildOperationMetadata {
  931. // The build that the operation is tracking.
  932. Build build = 1;
  933. }
  934. // Provenance of the source. Ways to find the original source, or verify that
  935. // some source was used for this build.
  936. message SourceProvenance {
  937. // A copy of the build's `source.storage_source`, if exists, with any
  938. // generations resolved.
  939. StorageSource resolved_storage_source = 3;
  940. // A copy of the build's `source.repo_source`, if exists, with any
  941. // revisions resolved.
  942. RepoSource resolved_repo_source = 6;
  943. // A copy of the build's `source.storage_source_manifest`, if exists, with any
  944. // revisions resolved.
  945. // This feature is in Preview.
  946. StorageSourceManifest resolved_storage_source_manifest = 9;
  947. // Output only. Hash(es) of the build source, which can be used to verify that
  948. // the original source integrity was maintained in the build. Note that
  949. // `FileHashes` will only be populated if `BuildOptions` has requested a
  950. // `SourceProvenanceHash`.
  951. //
  952. // The keys to this map are file paths used as build source and the values
  953. // contain the hash values for those files.
  954. //
  955. // If the build source came in a single package such as a gzipped tarfile
  956. // (`.tar.gz`), the `FileHash` will be for the single path to that file.
  957. map<string, FileHashes> file_hashes = 4
  958. [(google.api.field_behavior) = OUTPUT_ONLY];
  959. }
  960. // Container message for hashes of byte content of files, used in
  961. // SourceProvenance messages to verify integrity of source input to the build.
  962. message FileHashes {
  963. // Collection of file hashes.
  964. repeated Hash file_hash = 1;
  965. }
  966. // Container message for hash values.
  967. message Hash {
  968. // Specifies the hash algorithm, if any.
  969. enum HashType {
  970. // No hash requested.
  971. NONE = 0;
  972. // Use a sha256 hash.
  973. SHA256 = 1;
  974. // Use a md5 hash.
  975. MD5 = 2;
  976. }
  977. // The type of hash that was performed.
  978. HashType type = 1;
  979. // The hash value.
  980. bytes value = 2;
  981. }
  982. // Secrets and secret environment variables.
  983. message Secrets {
  984. // Secrets in Secret Manager and associated secret environment variable.
  985. repeated SecretManagerSecret secret_manager = 1;
  986. // Secrets encrypted with KMS key and the associated secret environment
  987. // variable.
  988. repeated InlineSecret inline = 2;
  989. }
  990. // Pairs a set of secret environment variables mapped to encrypted
  991. // values with the Cloud KMS key to use to decrypt the value.
  992. message InlineSecret {
  993. // Resource name of Cloud KMS crypto key to decrypt the encrypted value.
  994. // In format: projects/*/locations/*/keyRings/*/cryptoKeys/*
  995. string kms_key_name = 1 [(google.api.resource_reference) = {
  996. type: "cloudkms.googleapis.com/CryptoKey"
  997. }];
  998. // Map of environment variable name to its encrypted value.
  999. //
  1000. // Secret environment variables must be unique across all of a build's
  1001. // secrets, and must be used by at least one build step. Values can be at most
  1002. // 64 KB in size. There can be at most 100 secret values across all of a
  1003. // build's secrets.
  1004. map<string, bytes> env_map = 2;
  1005. }
  1006. // Pairs a secret environment variable with a SecretVersion in Secret Manager.
  1007. message SecretManagerSecret {
  1008. // Resource name of the SecretVersion. In format:
  1009. // projects/*/secrets/*/versions/*
  1010. string version_name = 1 [(google.api.resource_reference) = {
  1011. type: "secretmanager.googleapis.com/SecretVersion"
  1012. }];
  1013. // Environment variable name to associate with the secret.
  1014. // Secret environment variables must be unique across all of a build's
  1015. // secrets, and must be used by at least one build step.
  1016. string env = 2;
  1017. }
  1018. // Pairs a set of secret environment variables containing encrypted
  1019. // values with the Cloud KMS key to use to decrypt the value.
  1020. // Note: Use `kmsKeyName` with `available_secrets` instead of using
  1021. // `kmsKeyName` with `secret`. For instructions see:
  1022. // https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-credentials.
  1023. message Secret {
  1024. // Cloud KMS key name to use to decrypt these envs.
  1025. string kms_key_name = 1;
  1026. // Map of environment variable name to its encrypted value.
  1027. //
  1028. // Secret environment variables must be unique across all of a build's
  1029. // secrets, and must be used by at least one build step. Values can be at most
  1030. // 64 KB in size. There can be at most 100 secret values across all of a
  1031. // build's secrets.
  1032. map<string, bytes> secret_env = 3;
  1033. }
  1034. // Request to create a new build.
  1035. message CreateBuildRequest {
  1036. // The parent resource where this build will be created.
  1037. // Format: `projects/{project}/locations/{location}`
  1038. string parent = 4 [(google.api.resource_reference) = {
  1039. child_type: "cloudbuild.googleapis.com/Build"
  1040. }];
  1041. // Required. ID of the project.
  1042. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  1043. // Required. Build resource to create.
  1044. Build build = 2 [(google.api.field_behavior) = REQUIRED];
  1045. }
  1046. // Request to get a build.
  1047. message GetBuildRequest {
  1048. // The name of the `Build` to retrieve.
  1049. // Format: `projects/{project}/locations/{location}/builds/{build}`
  1050. string name = 4 [(google.api.resource_reference) = {
  1051. type: "cloudbuild.googleapis.com/Build"
  1052. }];
  1053. // Required. ID of the project.
  1054. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  1055. // Required. ID of the build.
  1056. string id = 2 [(google.api.field_behavior) = REQUIRED];
  1057. }
  1058. // Request to list builds.
  1059. message ListBuildsRequest {
  1060. // The parent of the collection of `Builds`.
  1061. // Format: `projects/{project}/locations/location`
  1062. string parent = 9 [(google.api.resource_reference) = {
  1063. child_type: "cloudbuild.googleapis.com/Build"
  1064. }];
  1065. // Required. ID of the project.
  1066. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  1067. // Number of results to return in the list.
  1068. int32 page_size = 2;
  1069. // The page token for the next page of Builds.
  1070. //
  1071. // If unspecified, the first page of results is returned.
  1072. //
  1073. // If the token is rejected for any reason, INVALID_ARGUMENT will be thrown.
  1074. // In this case, the token should be discarded, and pagination should be
  1075. // restarted from the first page of results.
  1076. //
  1077. // See https://google.aip.dev/158 for more.
  1078. string page_token = 3;
  1079. // The raw filter text to constrain the results.
  1080. string filter = 8;
  1081. }
  1082. // Response including listed builds.
  1083. message ListBuildsResponse {
  1084. // Builds will be sorted by `create_time`, descending.
  1085. repeated Build builds = 1;
  1086. // Token to receive the next page of results.
  1087. // This will be absent if the end of the response list has been reached.
  1088. string next_page_token = 2;
  1089. }
  1090. // Request to cancel an ongoing build.
  1091. message CancelBuildRequest {
  1092. // The name of the `Build` to cancel.
  1093. // Format: `projects/{project}/locations/{location}/builds/{build}`
  1094. string name = 4 [(google.api.resource_reference) = {
  1095. type: "cloudbuild.googleapis.com/Build"
  1096. }];
  1097. // Required. ID of the project.
  1098. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  1099. // Required. ID of the build.
  1100. string id = 2 [(google.api.field_behavior) = REQUIRED];
  1101. }
  1102. // Request to approve or reject a pending build.
  1103. message ApproveBuildRequest {
  1104. // Required. Name of the target build.
  1105. // For example: "projects/{$project_id}/builds/{$build_id}"
  1106. string name = 1 [(google.api.field_behavior) = REQUIRED];
  1107. // Approval decision and metadata.
  1108. ApprovalResult approval_result = 2;
  1109. }
  1110. // BuildApproval describes a build's approval configuration, state, and
  1111. // result.
  1112. message BuildApproval {
  1113. // Specifies the current state of a build's approval.
  1114. enum State {
  1115. // Default enum type. This should not be used.
  1116. STATE_UNSPECIFIED = 0;
  1117. // Build approval is pending.
  1118. PENDING = 1;
  1119. // Build approval has been approved.
  1120. APPROVED = 2;
  1121. // Build approval has been rejected.
  1122. REJECTED = 3;
  1123. // Build was cancelled while it was still pending approval.
  1124. CANCELLED = 5;
  1125. }
  1126. // Output only. The state of this build's approval.
  1127. State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  1128. // Output only. Configuration for manual approval of this build.
  1129. ApprovalConfig config = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  1130. // Output only. Result of manual approval for this Build.
  1131. ApprovalResult result = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  1132. }
  1133. // ApprovalConfig describes configuration for manual approval of a build.
  1134. message ApprovalConfig {
  1135. // Whether or not approval is needed. If this is set on a build, it will
  1136. // become pending when created, and will need to be explicitly approved
  1137. // to start.
  1138. bool approval_required = 1;
  1139. }
  1140. // ApprovalResult describes the decision and associated metadata of a manual
  1141. // approval of a build.
  1142. message ApprovalResult {
  1143. // Specifies whether or not this manual approval result is to approve
  1144. // or reject a build.
  1145. enum Decision {
  1146. // Default enum type. This should not be used.
  1147. DECISION_UNSPECIFIED = 0;
  1148. // Build is approved.
  1149. APPROVED = 1;
  1150. // Build is rejected.
  1151. REJECTED = 2;
  1152. }
  1153. // Output only. Email of the user that called the ApproveBuild API to
  1154. // approve or reject a build at the time that the API was called.
  1155. string approver_account = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  1156. // Output only. The time when the approval decision was made.
  1157. google.protobuf.Timestamp approval_time = 3
  1158. [(google.api.field_behavior) = OUTPUT_ONLY];
  1159. // Required. The decision of this manual approval.
  1160. Decision decision = 4 [(google.api.field_behavior) = REQUIRED];
  1161. // Optional. An optional comment for this manual approval result.
  1162. string comment = 5 [(google.api.field_behavior) = OPTIONAL];
  1163. // Optional. An optional URL tied to this manual approval result. This field
  1164. // is essentially the same as comment, except that it will be rendered by the
  1165. // UI differently. An example use case is a link to an external job that
  1166. // approved this Build.
  1167. string url = 6 [(google.api.field_behavior) = OPTIONAL];
  1168. }
  1169. // Configuration for an automated build in response to source repository
  1170. // changes.
  1171. message BuildTrigger {
  1172. option (google.api.resource) = {
  1173. type: "cloudbuild.googleapis.com/BuildTrigger"
  1174. plural: "triggers"
  1175. singular: "trigger"
  1176. pattern: "projects/{project}/triggers/{trigger}"
  1177. pattern: "projects/{project}/locations/{location}/triggers/{trigger}"
  1178. };
  1179. // The `Trigger` name with format:
  1180. // `projects/{project}/locations/{location}/triggers/{trigger}`, where
  1181. // {trigger} is a unique identifier generated by the service.
  1182. string resource_name = 34;
  1183. // Output only. Unique identifier of the trigger.
  1184. string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  1185. // Human-readable description of this trigger.
  1186. string description = 10;
  1187. // User-assigned name of the trigger. Must be unique within the project.
  1188. // Trigger names must meet the following requirements:
  1189. //
  1190. // + They must contain only alphanumeric characters and dashes.
  1191. // + They can be 1-64 characters long.
  1192. // + They must begin and end with an alphanumeric character.
  1193. string name = 21;
  1194. // Tags for annotation of a `BuildTrigger`
  1195. repeated string tags = 19;
  1196. // Template describing the types of source changes to trigger a build.
  1197. //
  1198. // Branch and tag names in trigger templates are interpreted as regular
  1199. // expressions. Any branch or tag change that matches that regular expression
  1200. // will trigger a build.
  1201. //
  1202. // Mutually exclusive with `github`.
  1203. RepoSource trigger_template = 7;
  1204. // GitHubEventsConfig describes the configuration of a trigger that creates
  1205. // a build whenever a GitHub event is received.
  1206. //
  1207. // Mutually exclusive with `trigger_template`.
  1208. GitHubEventsConfig github = 13;
  1209. // PubsubConfig describes the configuration of a trigger that
  1210. // creates a build whenever a Pub/Sub message is published.
  1211. PubsubConfig pubsub_config = 29;
  1212. // WebhookConfig describes the configuration of a trigger that
  1213. // creates a build whenever a webhook is sent to a trigger's webhook URL.
  1214. WebhookConfig webhook_config = 31;
  1215. // Template describing the Build request to make when the trigger is matched.
  1216. oneof build_template {
  1217. // Autodetect build configuration. The following precedence is used (case
  1218. // insensitive):
  1219. //
  1220. // 1. cloudbuild.yaml
  1221. // 2. cloudbuild.yml
  1222. // 3. cloudbuild.json
  1223. // 4. Dockerfile
  1224. //
  1225. // Currently only available for GitHub App Triggers.
  1226. bool autodetect = 18;
  1227. // Contents of the build template.
  1228. Build build = 4;
  1229. // Path, from the source root, to the build configuration file
  1230. // (i.e. cloudbuild.yaml).
  1231. string filename = 8;
  1232. }
  1233. // Output only. Time when the trigger was created.
  1234. google.protobuf.Timestamp create_time = 5
  1235. [(google.api.field_behavior) = OUTPUT_ONLY];
  1236. // If true, the trigger will never automatically execute a build.
  1237. bool disabled = 9;
  1238. // Substitutions for Build resource. The keys must match the following
  1239. // regular expression: `^_[A-Z0-9_]+$`.
  1240. map<string, string> substitutions = 11;
  1241. // ignored_files and included_files are file glob matches using
  1242. // https://golang.org/pkg/path/filepath/#Match extended with support for "**".
  1243. //
  1244. // If ignored_files and changed files are both empty, then they are
  1245. // not used to determine whether or not to trigger a build.
  1246. //
  1247. // If ignored_files is not empty, then we ignore any files that match
  1248. // any of the ignored_file globs. If the change has no files that are
  1249. // outside of the ignored_files globs, then we do not trigger a build.
  1250. repeated string ignored_files = 15;
  1251. // If any of the files altered in the commit pass the ignored_files
  1252. // filter and included_files is empty, then as far as this filter is
  1253. // concerned, we should trigger the build.
  1254. //
  1255. // If any of the files altered in the commit pass the ignored_files
  1256. // filter and included_files is not empty, then we make sure that at
  1257. // least one of those files matches a included_files glob. If not,
  1258. // then we do not trigger a build.
  1259. repeated string included_files = 16;
  1260. // Optional. A Common Expression Language string.
  1261. string filter = 30 [(google.api.field_behavior) = OPTIONAL];
  1262. // The service account used for all user-controlled operations including
  1263. // UpdateBuildTrigger, RunBuildTrigger, CreateBuild, and CancelBuild.
  1264. // If no service account is set, then the standard Cloud Build service account
  1265. // ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead.
  1266. // Format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}`
  1267. string service_account = 33 [(google.api.resource_reference) = {
  1268. type: "iam.googleapis.com/ServiceAccount"
  1269. }];
  1270. }
  1271. // GitHubEventsConfig describes the configuration of a trigger that creates a
  1272. // build whenever a GitHub event is received.
  1273. //
  1274. // This message is experimental.
  1275. message GitHubEventsConfig {
  1276. // The installationID that emits the GitHub event.
  1277. int64 installation_id = 1 [deprecated = true];
  1278. // Owner of the repository. For example: The owner for
  1279. // https://github.com/googlecloudplatform/cloud-builders is
  1280. // "googlecloudplatform".
  1281. string owner = 6;
  1282. // Name of the repository. For example: The name for
  1283. // https://github.com/googlecloudplatform/cloud-builders is "cloud-builders".
  1284. string name = 7;
  1285. // Filter describing the types of events to trigger a build.
  1286. // Currently supported event types: push, pull_request.
  1287. oneof event {
  1288. // filter to match changes in pull requests.
  1289. PullRequestFilter pull_request = 4;
  1290. // filter to match changes in refs like branches, tags.
  1291. PushFilter push = 5;
  1292. }
  1293. }
  1294. // PubsubConfig describes the configuration of a trigger that
  1295. // creates a build whenever a Pub/Sub message is published.
  1296. message PubsubConfig {
  1297. // Enumerates potential issues with the underlying Pub/Sub subscription
  1298. // configuration.
  1299. enum State {
  1300. // The subscription configuration has not been checked.
  1301. STATE_UNSPECIFIED = 0;
  1302. // The Pub/Sub subscription is properly configured.
  1303. OK = 1;
  1304. // The subscription has been deleted.
  1305. SUBSCRIPTION_DELETED = 2;
  1306. // The topic has been deleted.
  1307. TOPIC_DELETED = 3;
  1308. // Some of the subscription's field are misconfigured.
  1309. SUBSCRIPTION_MISCONFIGURED = 4;
  1310. }
  1311. // Output only. Name of the subscription. Format is
  1312. // `projects/{project}/subscriptions/{subscription}`.
  1313. string subscription = 1 [
  1314. (google.api.field_behavior) = OUTPUT_ONLY,
  1315. (google.api.resource_reference) = {
  1316. type: "pubsub.googleapis.com/Subscription"
  1317. }
  1318. ];
  1319. // The name of the topic from which this subscription is receiving messages.
  1320. // Format is `projects/{project}/topics/{topic}`.
  1321. string topic = 2 [
  1322. (google.api.resource_reference) = { type: "pubsub.googleapis.com/Topic" }
  1323. ];
  1324. // Service account that will make the push request.
  1325. string service_account_email = 3 [(google.api.resource_reference) = {
  1326. type: "iam.googleapis.com/ServiceAccount"
  1327. }];
  1328. // Potential issues with the underlying Pub/Sub subscription configuration.
  1329. // Only populated on get requests.
  1330. State state = 4;
  1331. }
  1332. // WebhookConfig describes the configuration of a trigger that
  1333. // creates a build whenever a webhook is sent to a trigger's webhook URL.
  1334. message WebhookConfig {
  1335. // Enumerates potential issues with the Secret Manager secret provided by the
  1336. // user.
  1337. enum State {
  1338. // The webhook auth configuration not been checked.
  1339. STATE_UNSPECIFIED = 0;
  1340. // The auth configuration is properly setup.
  1341. OK = 1;
  1342. // The secret provided in auth_method has been deleted.
  1343. SECRET_DELETED = 2;
  1344. }
  1345. // Auth method specifies how the webhook authenticates with GCP.
  1346. oneof auth_method {
  1347. // Required. Resource name for the secret required as a URL parameter.
  1348. string secret = 3 [
  1349. (google.api.field_behavior) = REQUIRED,
  1350. (google.api.resource_reference) = {
  1351. type: "secretmanager.googleapis.com/SecretVersion"
  1352. }
  1353. ];
  1354. }
  1355. // Potential issues with the underlying Pub/Sub subscription configuration.
  1356. // Only populated on get requests.
  1357. State state = 4;
  1358. }
  1359. // PullRequestFilter contains filter properties for matching GitHub Pull
  1360. // Requests.
  1361. message PullRequestFilter {
  1362. // Controls behavior of Pull Request comments.
  1363. enum CommentControl {
  1364. // Do not require comments on Pull Requests before builds are triggered.
  1365. COMMENTS_DISABLED = 0;
  1366. // Enforce that repository owners or collaborators must comment on Pull
  1367. // Requests before builds are triggered.
  1368. COMMENTS_ENABLED = 1;
  1369. // Enforce that repository owners or collaborators must comment on external
  1370. // contributors' Pull Requests before builds are triggered.
  1371. COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY = 2;
  1372. }
  1373. // Target refs to match.
  1374. // A target ref is the git reference where the pull request will be applied.
  1375. oneof git_ref {
  1376. // Regex of branches to match.
  1377. //
  1378. // The syntax of the regular expressions accepted is the syntax accepted by
  1379. // RE2 and described at https://github.com/google/re2/wiki/Syntax
  1380. string branch = 2;
  1381. }
  1382. // Configure builds to run whether a repository owner or collaborator need to
  1383. // comment `/gcbrun`.
  1384. CommentControl comment_control = 5;
  1385. // If true, branches that do NOT match the git_ref will trigger a build.
  1386. bool invert_regex = 6;
  1387. }
  1388. // Push contains filter properties for matching GitHub git pushes.
  1389. message PushFilter {
  1390. // Modified refs to match.
  1391. // A modified refs are the refs modified by a git push operation.
  1392. oneof git_ref {
  1393. // Regexes matching branches to build.
  1394. //
  1395. // The syntax of the regular expressions accepted is the syntax accepted by
  1396. // RE2 and described at https://github.com/google/re2/wiki/Syntax
  1397. string branch = 2;
  1398. // Regexes matching tags to build.
  1399. //
  1400. // The syntax of the regular expressions accepted is the syntax accepted by
  1401. // RE2 and described at https://github.com/google/re2/wiki/Syntax
  1402. string tag = 3;
  1403. }
  1404. // When true, only trigger a build if the revision regex does NOT match the
  1405. // git_ref regex.
  1406. bool invert_regex = 4;
  1407. }
  1408. // Request to create a new `BuildTrigger`.
  1409. message CreateBuildTriggerRequest {
  1410. // The parent resource where this trigger will be created.
  1411. // Format: `projects/{project}/locations/{location}`
  1412. string parent = 3 [(google.api.resource_reference) = {
  1413. child_type: "cloudbuild.googleapis.com/BuildTrigger"
  1414. }];
  1415. // Required. ID of the project for which to configure automatic builds.
  1416. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  1417. // Required. `BuildTrigger` to create.
  1418. BuildTrigger trigger = 2 [(google.api.field_behavior) = REQUIRED];
  1419. }
  1420. // Returns the `BuildTrigger` with the specified ID.
  1421. message GetBuildTriggerRequest {
  1422. // The name of the `Trigger` to retrieve.
  1423. // Format: `projects/{project}/locations/{location}/triggers/{trigger}`
  1424. string name = 3 [(google.api.resource_reference) = {
  1425. type: "cloudbuild.googleapis.com/BuildTrigger"
  1426. }];
  1427. // Required. ID of the project that owns the trigger.
  1428. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  1429. // Required. Identifier (`id` or `name`) of the `BuildTrigger` to get.
  1430. string trigger_id = 2 [(google.api.field_behavior) = REQUIRED];
  1431. }
  1432. // Request to list existing `BuildTriggers`.
  1433. message ListBuildTriggersRequest {
  1434. // The parent of the collection of `Triggers`.
  1435. // Format: `projects/{project}/locations/{location}`
  1436. string parent = 4 [(google.api.resource_reference) = {
  1437. child_type: "cloudbuild.googleapis.com/BuildTrigger"
  1438. }];
  1439. // Required. ID of the project for which to list BuildTriggers.
  1440. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  1441. // Number of results to return in the list.
  1442. int32 page_size = 2;
  1443. // Token to provide to skip to a particular spot in the list.
  1444. string page_token = 3;
  1445. }
  1446. // Response containing existing `BuildTriggers`.
  1447. message ListBuildTriggersResponse {
  1448. // `BuildTriggers` for the project, sorted by `create_time` descending.
  1449. repeated BuildTrigger triggers = 1;
  1450. // Token to receive the next page of results.
  1451. string next_page_token = 2;
  1452. }
  1453. // Request to delete a `BuildTrigger`.
  1454. message DeleteBuildTriggerRequest {
  1455. // The name of the `Trigger` to delete.
  1456. // Format: `projects/{project}/locations/{location}/triggers/{trigger}`
  1457. string name = 3 [(google.api.resource_reference) = {
  1458. type: "cloudbuild.googleapis.com/BuildTrigger"
  1459. }];
  1460. // Required. ID of the project that owns the trigger.
  1461. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  1462. // Required. ID of the `BuildTrigger` to delete.
  1463. string trigger_id = 2 [(google.api.field_behavior) = REQUIRED];
  1464. }
  1465. // Request to update an existing `BuildTrigger`.
  1466. message UpdateBuildTriggerRequest {
  1467. // Required. ID of the project that owns the trigger.
  1468. string project_id = 1 [(google.api.field_behavior) = REQUIRED];
  1469. // Required. ID of the `BuildTrigger` to update.
  1470. string trigger_id = 2 [(google.api.field_behavior) = REQUIRED];
  1471. // Required. `BuildTrigger` to update.
  1472. BuildTrigger trigger = 3 [(google.api.field_behavior) = REQUIRED];
  1473. }
  1474. // Optional arguments to enable specific features of builds.
  1475. message BuildOptions {
  1476. // Details about how a build should be executed on a `WorkerPool`.
  1477. //
  1478. // See [running builds in a private
  1479. // pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool)
  1480. // for more information.
  1481. message PoolOption {
  1482. // The `WorkerPool` resource to execute the build on.
  1483. // You must have `cloudbuild.workerpools.use` on the project hosting the
  1484. // WorkerPool.
  1485. //
  1486. // Format projects/{project}/locations/{location}/workerPools/{workerPoolId}
  1487. string name = 1 [(google.api.resource_reference) = {
  1488. type: "cloudbuild.googleapis.com/WorkerPool"
  1489. }];
  1490. }
  1491. // Specifies the manner in which the build should be verified, if at all.
  1492. enum VerifyOption {
  1493. // Not a verifiable build. (default)
  1494. NOT_VERIFIED = 0;
  1495. // Verified build.
  1496. VERIFIED = 1;
  1497. }
  1498. // Supported Compute Engine machine types.
  1499. // For more information, see [Machine
  1500. // types](https://cloud.google.com/compute/docs/machine-types).
  1501. enum MachineType {
  1502. // Standard machine type.
  1503. UNSPECIFIED = 0;
  1504. // Highcpu machine with 8 CPUs.
  1505. N1_HIGHCPU_8 = 1;
  1506. // Highcpu machine with 32 CPUs.
  1507. N1_HIGHCPU_32 = 2;
  1508. // Highcpu e2 machine with 8 CPUs.
  1509. E2_HIGHCPU_8 = 5;
  1510. // Highcpu e2 machine with 32 CPUs.
  1511. E2_HIGHCPU_32 = 6;
  1512. }
  1513. // Specifies the behavior when there is an error in the substitution checks.
  1514. enum SubstitutionOption {
  1515. // Fails the build if error in substitutions checks, like missing
  1516. // a substitution in the template or in the map.
  1517. MUST_MATCH = 0;
  1518. // Do not fail the build if error in substitutions checks.
  1519. ALLOW_LOOSE = 1;
  1520. }
  1521. // Specifies the behavior when writing build logs to Google Cloud Storage.
  1522. enum LogStreamingOption {
  1523. // Service may automatically determine build log streaming behavior.
  1524. STREAM_DEFAULT = 0;
  1525. // Build logs should be streamed to Google Cloud Storage.
  1526. STREAM_ON = 1;
  1527. // Build logs should not be streamed to Google Cloud Storage; they will be
  1528. // written when the build is completed.
  1529. STREAM_OFF = 2;
  1530. }
  1531. // Specifies the logging mode.
  1532. enum LoggingMode {
  1533. // The service determines the logging mode. The default is `LEGACY`. Do not
  1534. // rely on the default logging behavior as it may change in the future.
  1535. LOGGING_UNSPECIFIED = 0;
  1536. // Cloud Logging and Cloud Storage logging are enabled.
  1537. LEGACY = 1;
  1538. // Only Cloud Storage logging is enabled.
  1539. GCS_ONLY = 2;
  1540. // This option is the same as CLOUD_LOGGING_ONLY.
  1541. STACKDRIVER_ONLY = 3 [deprecated = true];
  1542. // Only Cloud Logging is enabled. Note that logs for both the Cloud Console
  1543. // UI and Cloud SDK are based on Cloud Storage logs, so neither will provide
  1544. // logs if this option is chosen.
  1545. CLOUD_LOGGING_ONLY = 5;
  1546. // Turn off all logging. No build logs will be captured.
  1547. NONE = 4;
  1548. }
  1549. // Requested hash for SourceProvenance.
  1550. repeated Hash.HashType source_provenance_hash = 1;
  1551. // Requested verifiability options.
  1552. VerifyOption requested_verify_option = 2;
  1553. // Compute Engine machine type on which to run the build.
  1554. MachineType machine_type = 3;
  1555. // Requested disk size for the VM that runs the build. Note that this is *NOT*
  1556. // "disk free"; some of the space will be used by the operating system and
  1557. // build utilities. Also note that this is the minimum disk size that will be
  1558. // allocated for the build -- the build may run with a larger disk than
  1559. // requested. At present, the maximum disk size is 1000GB; builds that request
  1560. // more than the maximum are rejected with an error.
  1561. int64 disk_size_gb = 6;
  1562. // Option to specify behavior when there is an error in the substitution
  1563. // checks.
  1564. //
  1565. // NOTE: this is always set to ALLOW_LOOSE for triggered builds and cannot
  1566. // be overridden in the build configuration file.
  1567. SubstitutionOption substitution_option = 4;
  1568. // Option to specify whether or not to apply bash style string
  1569. // operations to the substitutions.
  1570. //
  1571. // NOTE: this is always enabled for triggered builds and cannot be
  1572. // overridden in the build configuration file.
  1573. bool dynamic_substitutions = 17;
  1574. // Option to define build log streaming behavior to Google Cloud
  1575. // Storage.
  1576. LogStreamingOption log_streaming_option = 5;
  1577. // This field deprecated; please use `pool.name` instead.
  1578. string worker_pool = 7 [deprecated = true];
  1579. // Optional. Specification for execution on a `WorkerPool`.
  1580. //
  1581. // See [running builds in a private
  1582. // pool](https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool)
  1583. // for more information.
  1584. PoolOption pool = 19 [(google.api.field_behavior) = OPTIONAL];
  1585. // Option to specify the logging mode, which determines if and where build
  1586. // logs are stored.
  1587. LoggingMode logging = 11;
  1588. // A list of global environment variable definitions that will exist for all
  1589. // build steps in this build. If a variable is defined in both globally and in
  1590. // a build step, the variable will use the build step value.
  1591. //
  1592. // The elements are of the form "KEY=VALUE" for the environment variable "KEY"
  1593. // being given the value "VALUE".
  1594. repeated string env = 12;
  1595. // A list of global environment variables, which are encrypted using a Cloud
  1596. // Key Management Service crypto key. These values must be specified in the
  1597. // build's `Secret`. These variables will be available to all build steps
  1598. // in this build.
  1599. repeated string secret_env = 13;
  1600. // Global list of volumes to mount for ALL build steps
  1601. //
  1602. // Each volume is created as an empty volume prior to starting the build
  1603. // process. Upon completion of the build, volumes and their contents are
  1604. // discarded. Global volume names and paths cannot conflict with the volumes
  1605. // defined a build step.
  1606. //
  1607. // Using a global volume in a build with only one step is not valid as
  1608. // it is indicative of a build request with an incorrect configuration.
  1609. repeated Volume volumes = 14;
  1610. }
  1611. // ReceiveTriggerWebhookRequest [Experimental] is the request object accepted by
  1612. // the ReceiveTriggerWebhook method.
  1613. message ReceiveTriggerWebhookRequest {
  1614. // The name of the `ReceiveTriggerWebhook` to retrieve.
  1615. // Format: `projects/{project}/locations/{location}/triggers/{trigger}`
  1616. string name = 5;
  1617. // HTTP request body.
  1618. google.api.HttpBody body = 1;
  1619. // Project in which the specified trigger lives
  1620. string project_id = 2;
  1621. // Name of the trigger to run the payload against
  1622. string trigger = 3;
  1623. // Secret token used for authorization if an OAuth token isn't provided.
  1624. string secret = 4;
  1625. }
  1626. // ReceiveTriggerWebhookResponse [Experimental] is the response object for the
  1627. // ReceiveTriggerWebhook method.
  1628. message ReceiveTriggerWebhookResponse {}
  1629. // Configuration for a `WorkerPool`.
  1630. //
  1631. // Cloud Build owns and maintains a pool of workers for general use and have no
  1632. // access to a project's private network. By default, builds submitted to
  1633. // Cloud Build will use a worker from this pool.
  1634. //
  1635. // If your build needs access to resources on a private network,
  1636. // create and use a `WorkerPool` to run your builds. Private `WorkerPool`s give
  1637. // your builds access to any single VPC network that you
  1638. // administer, including any on-prem resources connected to that VPC
  1639. // network. For an overview of private pools, see
  1640. // [Private pools
  1641. // overview](https://cloud.google.com/build/docs/private-pools/private-pools-overview).
  1642. message WorkerPool {
  1643. option (google.api.resource) = {
  1644. type: "cloudbuild.googleapis.com/WorkerPool"
  1645. pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}"
  1646. plural: "workerPools"
  1647. singular: "workerPool"
  1648. style: DECLARATIVE_FRIENDLY
  1649. };
  1650. // State of the `WorkerPool`.
  1651. enum State {
  1652. // State of the `WorkerPool` is unknown.
  1653. STATE_UNSPECIFIED = 0;
  1654. // `WorkerPool` is being created.
  1655. CREATING = 1;
  1656. // `WorkerPool` is running.
  1657. RUNNING = 2;
  1658. // `WorkerPool` is being deleted: cancelling builds and draining workers.
  1659. DELETING = 3;
  1660. // `WorkerPool` is deleted.
  1661. DELETED = 4;
  1662. }
  1663. // Output only. The resource name of the `WorkerPool`, with format
  1664. // `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
  1665. // The value of `{worker_pool}` is provided by `worker_pool_id` in
  1666. // `CreateWorkerPool` request and the value of `{location}` is determined by
  1667. // the endpoint accessed.
  1668. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  1669. // A user-specified, human-readable name for the `WorkerPool`. If provided,
  1670. // this value must be 1-63 characters.
  1671. string display_name = 2;
  1672. // Output only. A unique identifier for the `WorkerPool`.
  1673. string uid = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  1674. // User specified annotations. See https://google.aip.dev/128#annotations
  1675. // for more details such as format and size limitations.
  1676. map<string, string> annotations = 4;
  1677. // Output only. Time at which the request to create the `WorkerPool` was
  1678. // received.
  1679. google.protobuf.Timestamp create_time = 5
  1680. [(google.api.field_behavior) = OUTPUT_ONLY];
  1681. // Output only. Time at which the request to update the `WorkerPool` was
  1682. // received.
  1683. google.protobuf.Timestamp update_time = 6
  1684. [(google.api.field_behavior) = OUTPUT_ONLY];
  1685. // Output only. Time at which the request to delete the `WorkerPool` was
  1686. // received.
  1687. google.protobuf.Timestamp delete_time = 7
  1688. [(google.api.field_behavior) = OUTPUT_ONLY];
  1689. // Output only. `WorkerPool` state.
  1690. State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  1691. // Private Pool configuration for the `WorkerPool`.
  1692. oneof config {
  1693. // Private Pool using a v1 configuration.
  1694. PrivatePoolV1Config private_pool_v1_config = 12;
  1695. }
  1696. // Output only. Checksum computed by the server. May be sent on update and
  1697. // delete requests to ensure that the client has an up-to-date value before
  1698. // proceeding.
  1699. string etag = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  1700. }
  1701. // Configuration for a V1 `PrivatePool`.
  1702. message PrivatePoolV1Config {
  1703. // Defines the configuration to be used for creating workers in
  1704. // the pool.
  1705. message WorkerConfig {
  1706. // Machine type of a worker, such as `e2-medium`.
  1707. // See [Worker pool config
  1708. // file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema).
  1709. // If left blank, Cloud Build will use a sensible default.
  1710. string machine_type = 1;
  1711. // Size of the disk attached to the worker, in GB.
  1712. // See [Worker pool config
  1713. // file](https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema).
  1714. // Specify a value of up to 1000. If `0` is specified, Cloud Build will use
  1715. // a standard disk size.
  1716. int64 disk_size_gb = 2;
  1717. }
  1718. // Defines the network configuration for the pool.
  1719. message NetworkConfig {
  1720. // Defines the egress option for the pool.
  1721. enum EgressOption {
  1722. // If set, defaults to PUBLIC_EGRESS.
  1723. EGRESS_OPTION_UNSPECIFIED = 0;
  1724. // If set, workers are created without any public address, which prevents
  1725. // network egress to public IPs unless a network proxy is configured.
  1726. NO_PUBLIC_EGRESS = 1;
  1727. // If set, workers are created with a public address which allows for
  1728. // public internet egress.
  1729. PUBLIC_EGRESS = 2;
  1730. }
  1731. // Required. Immutable. The network definition that the workers are peered
  1732. // to. If this section is left empty, the workers will be peered to
  1733. // `WorkerPool.project_id` on the service producer network. Must be in the
  1734. // format `projects/{project}/global/networks/{network}`, where `{project}`
  1735. // is a project number, such as `12345`, and `{network}` is the name of a
  1736. // VPC network in the project. See
  1737. // [Understanding network configuration
  1738. // options](https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment)
  1739. string peered_network = 1 [
  1740. (google.api.field_behavior) = IMMUTABLE,
  1741. (google.api.field_behavior) = REQUIRED,
  1742. (google.api.resource_reference) = {
  1743. type: "compute.googleapis.com/Network"
  1744. }
  1745. ];
  1746. // Option to configure network egress for the workers.
  1747. EgressOption egress_option = 2;
  1748. }
  1749. // Machine configuration for the workers in the pool.
  1750. WorkerConfig worker_config = 1;
  1751. // Network configuration for the pool.
  1752. NetworkConfig network_config = 2;
  1753. }
  1754. // Request to create a new `WorkerPool`.
  1755. message CreateWorkerPoolRequest {
  1756. // Required. The parent resource where this worker pool will be created.
  1757. // Format: `projects/{project}/locations/{location}`.
  1758. string parent = 1 [
  1759. (google.api.field_behavior) = REQUIRED,
  1760. (google.api.resource_reference) = {
  1761. type: "locations.googleapis.com/Location"
  1762. }
  1763. ];
  1764. // Required. `WorkerPool` resource to create.
  1765. WorkerPool worker_pool = 2 [(google.api.field_behavior) = REQUIRED];
  1766. // Required. Immutable. The ID to use for the `WorkerPool`, which will become
  1767. // the final component of the resource name.
  1768. //
  1769. // This value should be 1-63 characters, and valid characters
  1770. // are /[a-z][0-9]-/.
  1771. string worker_pool_id = 3 [
  1772. (google.api.field_behavior) = IMMUTABLE,
  1773. (google.api.field_behavior) = REQUIRED
  1774. ];
  1775. // If set, validate the request and preview the response, but do not actually
  1776. // post it.
  1777. bool validate_only = 4;
  1778. }
  1779. // Request to get a `WorkerPool` with the specified name.
  1780. message GetWorkerPoolRequest {
  1781. // Required. The name of the `WorkerPool` to retrieve.
  1782. // Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`.
  1783. string name = 1 [
  1784. (google.api.field_behavior) = REQUIRED,
  1785. (google.api.resource_reference) = {
  1786. type: "cloudbuild.googleapis.com/WorkerPool"
  1787. }
  1788. ];
  1789. }
  1790. // Request to delete a `WorkerPool`.
  1791. message DeleteWorkerPoolRequest {
  1792. // Required. The name of the `WorkerPool` to delete.
  1793. // Format:
  1794. // `projects/{project}/locations/{workerPool}/workerPools/{workerPool}`.
  1795. string name = 1 [
  1796. (google.api.field_behavior) = REQUIRED,
  1797. (google.api.resource_reference) = {
  1798. type: "cloudbuild.googleapis.com/WorkerPool"
  1799. }
  1800. ];
  1801. // Optional. If this is provided, it must match the server's etag on the
  1802. // workerpool for the request to be processed.
  1803. string etag = 2;
  1804. // If set to true, and the `WorkerPool` is not found, the request will succeed
  1805. // but no action will be taken on the server.
  1806. bool allow_missing = 3;
  1807. // If set, validate the request and preview the response, but do not actually
  1808. // post it.
  1809. bool validate_only = 4;
  1810. }
  1811. // Request to update a `WorkerPool`.
  1812. message UpdateWorkerPoolRequest {
  1813. // Required. The `WorkerPool` to update.
  1814. //
  1815. // The `name` field is used to identify the `WorkerPool` to update.
  1816. // Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`.
  1817. WorkerPool worker_pool = 1 [(google.api.field_behavior) = REQUIRED];
  1818. // A mask specifying which fields in `worker_pool` to update.
  1819. google.protobuf.FieldMask update_mask = 2;
  1820. // If set, validate the request and preview the response, but do not actually
  1821. // post it.
  1822. bool validate_only = 4;
  1823. }
  1824. // Request to list `WorkerPool`s.
  1825. message ListWorkerPoolsRequest {
  1826. // Required. The parent of the collection of `WorkerPools`.
  1827. // Format: `projects/{project}/locations/{location}`.
  1828. string parent = 1 [
  1829. (google.api.field_behavior) = REQUIRED,
  1830. (google.api.resource_reference) = {
  1831. type: "locations.googleapis.com/Location"
  1832. }
  1833. ];
  1834. // The maximum number of `WorkerPool`s to return. The service may return
  1835. // fewer than this value. If omitted, the server will use a sensible default.
  1836. int32 page_size = 2;
  1837. // A page token, received from a previous `ListWorkerPools` call. Provide this
  1838. // to retrieve the subsequent page.
  1839. string page_token = 3;
  1840. }
  1841. // Response containing existing `WorkerPools`.
  1842. message ListWorkerPoolsResponse {
  1843. // `WorkerPools` for the specified project.
  1844. repeated WorkerPool worker_pools = 1;
  1845. // Continuation token used to page through large result sets. Provide this
  1846. // value in a subsequent ListWorkerPoolsRequest to return the next page of
  1847. // results.
  1848. string next_page_token = 2;
  1849. }
  1850. // Metadata for the `CreateWorkerPool` operation.
  1851. message CreateWorkerPoolOperationMetadata {
  1852. // The resource name of the `WorkerPool` to create.
  1853. // Format:
  1854. // `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
  1855. string worker_pool = 1 [(google.api.resource_reference) = {
  1856. type: "cloudbuild.googleapis.com/WorkerPool"
  1857. }];
  1858. // Time the operation was created.
  1859. google.protobuf.Timestamp create_time = 2;
  1860. // Time the operation was completed.
  1861. google.protobuf.Timestamp complete_time = 3;
  1862. }
  1863. // Metadata for the `UpdateWorkerPool` operation.
  1864. message UpdateWorkerPoolOperationMetadata {
  1865. // The resource name of the `WorkerPool` being updated.
  1866. // Format:
  1867. // `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
  1868. string worker_pool = 1 [(google.api.resource_reference) = {
  1869. type: "cloudbuild.googleapis.com/WorkerPool"
  1870. }];
  1871. // Time the operation was created.
  1872. google.protobuf.Timestamp create_time = 2;
  1873. // Time the operation was completed.
  1874. google.protobuf.Timestamp complete_time = 3;
  1875. }
  1876. // Metadata for the `DeleteWorkerPool` operation.
  1877. message DeleteWorkerPoolOperationMetadata {
  1878. // The resource name of the `WorkerPool` being deleted.
  1879. // Format:
  1880. // `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
  1881. string worker_pool = 1 [(google.api.resource_reference) = {
  1882. type: "cloudbuild.googleapis.com/WorkerPool"
  1883. }];
  1884. // Time the operation was created.
  1885. google.protobuf.Timestamp create_time = 2;
  1886. // Time the operation was completed.
  1887. google.protobuf.Timestamp complete_time = 3;
  1888. }