Skip to content

Commit

Permalink
feat: Integration of Cloud Build with Artifact Registry (#352)
Browse files Browse the repository at this point in the history
- [ ] Regenerate this pull request now.

Committer: @amcooper
PiperOrigin-RevId: 484745059

Source-Link: https://github.com/googleapis/googleapis/commit/b819b9552ddb98c5d2f68719c34b729cfa370fcc

Source-Link: https://github.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://github.com/googleapis/googleapis/commit/bc84ad52ed3d36c2433d8c5e8245166a6097159c

Source-Link: https://github.com/googleapis/googleapis-gen/commit/c6550a66efe7595832473efe51a58ddd0a05c2d8
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzY1NTBhNjZlZmU3NTk1ODMyNDczZWZlNTFhNThkZGQwYTA1YzJkOCJ9
END_NESTED_COMMIT
  • Loading branch information
gcf-owl-bot[bot] authored Nov 11, 2022
1 parent 9845e3d commit 3ef0070
Show file tree
Hide file tree
Showing 4 changed files with 4,603 additions and 2,568 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,30 @@ message BuiltImage {
TimeSpan push_timing = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Artifact uploaded using the PythonPackage directive.
message UploadedPythonPackage {
// URI of the uploaded artifact.
string uri = 1;

// Hash types and values of the Python Artifact.
FileHashes file_hashes = 2;

// Output only. Stores timing information for pushing the specified artifact.
TimeSpan push_timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// A Maven artifact uploaded using the MavenArtifact directive.
message UploadedMavenArtifact {
// URI of the uploaded artifact.
string uri = 1;

// Hash types and values of the Maven Artifact.
FileHashes file_hashes = 2;

// Output only. Stores timing information for pushing the specified artifact.
TimeSpan push_timing = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// A step in the build pipeline.
message BuildStep {
// Required. The name of the container image that will run this particular
Expand Down Expand Up @@ -598,6 +622,21 @@ message BuildStep {
// as the build progresses.
Build.Status status = 12 [(google.api.field_behavior) = OUTPUT_ONLY];

// Allow this build step to fail without failing the entire build.
//
// If false, the entire build will fail if this step fails. Otherwise, the
// build will succeed, but this step will still have a failure status.
// Error information will be reported in the failure_detail field.
bool allow_failure = 14;

// Output only. Return code from running the step.
int32 exit_code = 16 [(google.api.field_behavior) = OUTPUT_ONLY];

// Allow this build step to fail without failing the entire build if and
// only if the exit code is one of the specified codes. If allow_failure
// is also specified, this field will take precedence.
repeated int32 allow_exit_codes = 18;

// A shell script to be executed in the step.
//
// When script is provided, the user cannot specify the entrypoint or args.
Expand Down Expand Up @@ -645,6 +684,12 @@ message Results {

// Time to push all non-container artifacts.
TimeSpan artifact_timing = 7;

// Python artifacts uploaded to Artifact Registry at the end of the build.
repeated UploadedPythonPackage python_packages = 8;

// Maven artifacts uploaded to Artifact Registry at the end of the build.
repeated UploadedMavenArtifact maven_artifacts = 9;
}

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

// A Maven artifact to upload to Artifact Registry upon successful completion
// of all build steps.
message MavenArtifact {
// Artifact Registry repository, in the form
// "https://$REGION-maven.pkg.dev/$PROJECT/$REPOSITORY"
//
// Artifact in the workspace specified by path will be uploaded to
// Artifact Registry with this location as a prefix.
string repository = 1;

// Path to an artifact in the build's workspace to be uploaded to
// Artifact Registry.
// This can be either an absolute path,
// e.g. /workspace/my-app/target/my-app-1.0.SNAPSHOT.jar
// or a relative path from /workspace,
// e.g. my-app/target/my-app-1.0.SNAPSHOT.jar.
string path = 2;

// Maven `artifactId` value used when uploading the artifact to Artifact
// Registry.
string artifact_id = 3;

// Maven `groupId` value used when uploading the artifact to Artifact
// Registry.
string group_id = 4;

// Maven `version` value used when uploading the artifact to Artifact
// Registry.
string version = 5;
}

// Python package to upload to Artifact Registry upon successful completion
// of all build steps. A package can encapsulate multiple objects to be
// uploaded to a single repository.
message PythonPackage {
// Artifact Registry repository, in the form
// "https://$REGION-python.pkg.dev/$PROJECT/$REPOSITORY"
//
// Files in the workspace matching any path pattern will be uploaded to
// Artifact Registry with this location as a prefix.
string repository = 1;

// Path globs used to match files in the build's workspace. For Python/
// Twine, this is usually `dist/*`, and sometimes additionally an `.asc`
// file.
repeated string paths = 2;
}

// A list of images to be pushed upon the successful completion of all build
// steps.
//
Expand All @@ -961,6 +1054,24 @@ message Artifacts {
//
// If any objects fail to be pushed, the build is marked FAILURE.
ArtifactObjects objects = 2;

// A list of Maven artifacts to be uploaded to Artifact Registry upon
// successful completion of all build steps.
//
// Artifacts in the workspace matching specified paths globs will be uploaded
// to the specified Artifact Registry repository using the builder service
// account's credentials.
//
// If any artifacts fail to be pushed, the build is marked FAILURE.
repeated MavenArtifact maven_artifacts = 3;

// A list of Python packages to be uploaded to Artifact Registry upon
// successful completion of all build steps.
//
// The build service account credentials will be used to perform the upload.
//
// If any objects fail to be pushed, the build is marked FAILURE.
repeated PythonPackage python_packages = 5;
}

// Start and end times for a build execution phase.
Expand Down
Loading

0 comments on commit 3ef0070

Please sign in to comment.