Skip to content

Commit 3ef0070

Browse files
feat: Integration of Cloud Build with Artifact Registry (#352)
- [ ] Regenerate this pull request now. Committer: @amcooper PiperOrigin-RevId: 484745059 Source-Link: https://togithub.com/googleapis/googleapis/commit/b819b9552ddb98c5d2f68719c34b729cfa370fcc Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/b7ff84f154b8c5bc0b32208fe6c39827a2a86451 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjdmZjg0ZjE1NGI4YzViYzBiMzIyMDhmZTZjMzk4MjdhMmE4NjQ1MSJ9 BEGIN_NESTED_COMMIT feat: Add allow_failure, exit_code, and allow_exit_code to BuildStep message Committer: @arvinddayal PiperOrigin-RevId: 484308212 Source-Link: https://togithub.com/googleapis/googleapis/commit/bc84ad52ed3d36c2433d8c5e8245166a6097159c Source-Link: https://togithub.com/googleapis/googleapis-gen/commit/c6550a66efe7595832473efe51a58ddd0a05c2d8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzY1NTBhNjZlZmU3NTk1ODMyNDczZWZlNTFhNThkZGQwYTA1YzJkOCJ9 END_NESTED_COMMIT
1 parent 9845e3d commit 3ef0070

File tree

4 files changed

+4603
-2568
lines changed

4 files changed

+4603
-2568
lines changed

packages/google-devtools-cloudbuild/protos/google/devtools/cloudbuild/v1/cloudbuild.proto

+111
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,30 @@ message BuiltImage {
504504
TimeSpan push_timing = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
505505
}
506506

507+
// Artifact uploaded using the PythonPackage directive.
508+
message UploadedPythonPackage {
509+
// URI of the uploaded artifact.
510+
string uri = 1;
511+
512+
// Hash types and values of the Python Artifact.
513+
FileHashes file_hashes = 2;
514+
515+
// Output only. Stores timing information for pushing the specified artifact.
516+
TimeSpan push_timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
517+
}
518+
519+
// A Maven artifact uploaded using the MavenArtifact directive.
520+
message UploadedMavenArtifact {
521+
// URI of the uploaded artifact.
522+
string uri = 1;
523+
524+
// Hash types and values of the Maven Artifact.
525+
FileHashes file_hashes = 2;
526+
527+
// Output only. Stores timing information for pushing the specified artifact.
528+
TimeSpan push_timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
529+
}
530+
507531
// A step in the build pipeline.
508532
message BuildStep {
509533
// Required. The name of the container image that will run this particular
@@ -598,6 +622,21 @@ message BuildStep {
598622
// as the build progresses.
599623
Build.Status status = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
600624

625+
// Allow this build step to fail without failing the entire build.
626+
//
627+
// If false, the entire build will fail if this step fails. Otherwise, the
628+
// build will succeed, but this step will still have a failure status.
629+
// Error information will be reported in the failure_detail field.
630+
bool allow_failure = 14;
631+
632+
// Output only. Return code from running the step.
633+
int32 exit_code = 16 [(google.api.field_behavior) = OUTPUT_ONLY];
634+
635+
// Allow this build step to fail without failing the entire build if and
636+
// only if the exit code is one of the specified codes. If allow_failure
637+
// is also specified, this field will take precedence.
638+
repeated int32 allow_exit_codes = 18;
639+
601640
// A shell script to be executed in the step.
602641
//
603642
// When script is provided, the user cannot specify the entrypoint or args.
@@ -645,6 +684,12 @@ message Results {
645684

646685
// Time to push all non-container artifacts.
647686
TimeSpan artifact_timing = 7;
687+
688+
// Python artifacts uploaded to Artifact Registry at the end of the build.
689+
repeated UploadedPythonPackage python_packages = 8;
690+
691+
// Maven artifacts uploaded to Artifact Registry at the end of the build.
692+
repeated UploadedMavenArtifact maven_artifacts = 9;
648693
}
649694

650695
// An artifact that was uploaded during a build. This
@@ -938,6 +983,54 @@ message Artifacts {
938983
TimeSpan timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
939984
}
940985

986+
// A Maven artifact to upload to Artifact Registry upon successful completion
987+
// of all build steps.
988+
message MavenArtifact {
989+
// Artifact Registry repository, in the form
990+
// "https://$REGION-maven.pkg.dev/$PROJECT/$REPOSITORY"
991+
//
992+
// Artifact in the workspace specified by path will be uploaded to
993+
// Artifact Registry with this location as a prefix.
994+
string repository = 1;
995+
996+
// Path to an artifact in the build's workspace to be uploaded to
997+
// Artifact Registry.
998+
// This can be either an absolute path,
999+
// e.g. /workspace/my-app/target/my-app-1.0.SNAPSHOT.jar
1000+
// or a relative path from /workspace,
1001+
// e.g. my-app/target/my-app-1.0.SNAPSHOT.jar.
1002+
string path = 2;
1003+
1004+
// Maven `artifactId` value used when uploading the artifact to Artifact
1005+
// Registry.
1006+
string artifact_id = 3;
1007+
1008+
// Maven `groupId` value used when uploading the artifact to Artifact
1009+
// Registry.
1010+
string group_id = 4;
1011+
1012+
// Maven `version` value used when uploading the artifact to Artifact
1013+
// Registry.
1014+
string version = 5;
1015+
}
1016+
1017+
// Python package to upload to Artifact Registry upon successful completion
1018+
// of all build steps. A package can encapsulate multiple objects to be
1019+
// uploaded to a single repository.
1020+
message PythonPackage {
1021+
// Artifact Registry repository, in the form
1022+
// "https://$REGION-python.pkg.dev/$PROJECT/$REPOSITORY"
1023+
//
1024+
// Files in the workspace matching any path pattern will be uploaded to
1025+
// Artifact Registry with this location as a prefix.
1026+
string repository = 1;
1027+
1028+
// Path globs used to match files in the build's workspace. For Python/
1029+
// Twine, this is usually `dist/*`, and sometimes additionally an `.asc`
1030+
// file.
1031+
repeated string paths = 2;
1032+
}
1033+
9411034
// A list of images to be pushed upon the successful completion of all build
9421035
// steps.
9431036
//
@@ -961,6 +1054,24 @@ message Artifacts {
9611054
//
9621055
// If any objects fail to be pushed, the build is marked FAILURE.
9631056
ArtifactObjects objects = 2;
1057+
1058+
// A list of Maven artifacts to be uploaded to Artifact Registry upon
1059+
// successful completion of all build steps.
1060+
//
1061+
// Artifacts in the workspace matching specified paths globs will be uploaded
1062+
// to the specified Artifact Registry repository using the builder service
1063+
// account's credentials.
1064+
//
1065+
// If any artifacts fail to be pushed, the build is marked FAILURE.
1066+
repeated MavenArtifact maven_artifacts = 3;
1067+
1068+
// A list of Python packages to be uploaded to Artifact Registry upon
1069+
// successful completion of all build steps.
1070+
//
1071+
// The build service account credentials will be used to perform the upload.
1072+
//
1073+
// If any objects fail to be pushed, the build is marked FAILURE.
1074+
repeated PythonPackage python_packages = 5;
9641075
}
9651076

9661077
// Start and end times for a build execution phase.

0 commit comments

Comments
 (0)