import google.auth
from google.cloud.devtools import cloudbuild_v1
def quickstart():
"""Create and execute a simple Google Cloud Build configuration,
print the in-progress status and print the completed status."""
# Authorize the client with Google defaults
# If you're using Private Pools, add a regional `api_endpoint` to `CloudBuildClient()`
# For example, '<YOUR_POOL_REGION>-cloudbuild.googleapis.com'
credentials, project_id = google.auth.default()
client = cloudbuild_v1.services.cloud_build.CloudBuildClient()
build = cloudbuild_v1.Build()
# The following build steps will output "hello world"
# For more information on build configuration, see
# https://cloud.google.com/build/docs/configuring-builds/create-basic-configuration
build.steps = [{"name": "ubuntu",
"entrypoint": "bash",
"args": ["-c", "echo hello world"]}]
operation = client.create_build(project_id=project_id, build=build)
# Print the in-progress operation
print("IN PROGRESS:")
print(operation.metadata)
result = operation.result()
# Print the completed status
print("RESULT:", result.status)
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Difficile da capire"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Informazioni o codice di esempio errati"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Mancano le informazioni o gli esempi di cui ho bisogno"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"Problema di traduzione"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Altra"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Facile da capire"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Il problema è stato risolto"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Altra"
}]