def testBuildAsync(self):
     self._ExpectCreateBuild(logs_bucket='logs-bucket', stream_log=False)
     self.build.logsBucket = 'logs-bucket'
     result = self.client.ExecuteCloudBuildAsync(self.build,
                                                 project='my-project')
     result_build_id = build.GetBuildProp(result, 'id')
     self.assertEqual(result_build_id, 'build-id')
Beispiel #2
0
    def MakeImageArtifactFromOp(cls, build_op):
        """Create Image BuildArtifact from build operation."""
        source = build.GetBuildProp(build_op, 'source')
        for prop in source.object_value.properties:
            if prop.key == 'storageSource':
                for storage_prop in prop.value.object_value.properties:
                    if storage_prop.key == 'object':
                        image_name = storage_prop.value.string_value

        if image_name is None:
            raise build.BuildFailedError('Could not determine image name')

        return cls(cls.BuildType.IMAGE, image_name, build_op)
Beispiel #3
0
 def MakeBuildIdArtifactFromOp(cls, build_op):
     build_id = build.GetBuildProp(build_op, 'id', required=True)
     return cls(cls.BuildType.BUILD_ID, build_id, build_op)