问题
I configured a cloud schedular job following enter link description here
But find error status: "INVALID_ARGUMENT"
. did not understand from where it came from. any suggestion to fix this, would be grateful.
回答1:
You need to follow the bellow steps to trigger:
1.- Create a new Service Account and add the "Cloud Build Service Account" and "Cloud Scheduler Service Agent" roles to it.
2.- The HTTP method should be "post".
3.- You must specify in the body field the "repoName" and the "branchName". Use the below as example.
{
"repoName": "MyRepo",
"branchName": "MyBranch"
}
4.- Select "Add OAuth token" as Auth header.
5.-Assign the created SA to your Cloud Scheduler Job that want to use to trigger your cloud Build job.
6.-Use this value "https://www.googleapis.com/auth/cloud-platform" as Scope
Once you have these changes, you will be able to execute the trigger.
来源:https://stackoverflow.com/questions/61682555/how-to-trigger-a-google-cloud-build-job-periodically-from-google-cloud-scheduler