Notes:
- Make sure the Service Account running your Cloud Build job has sufficient permissions on BigQuery
- The table in the example has 2 columns,
datetime
(timestamp) anddeploy_sha
(string) - The dataset and table must exist already and in this example, they're both named
app_deploy_log
...
- id: app-version
name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:alpine'
entrypoint: 'bash'
args:
- '-c'
- |
echo '{"datetime":'$(date +%s)',"deploy_sha":"$SHORT_SHA"}' | bq --project_id=$PROJECT_ID insert app_deploy_log.app_deploy_log
...