GCP Cloud Build - How to read topic data in the cloudbuild

83 views Asked by At

GCP Cloud Build - How to read topic data in the cloudbuild

We are using pubsub to trigger the cloudbuild , now we need to read the data in the pubsub topic that triggered the cloud build

Thanks in advance

1

There are 1 answers

0
Sandeep Vokkareni On

Have a look at this Documentation on How to automate builds in response to Pub/Sub events.

As suggested in the Documentation make sure that the format of these messages indicates the real data is body.message.data, and that PubsubMessage is accessible as body.message.

And also as per Doc

You can store parts of your trigger's event payload as a substitution variable value. Payload bindings are available as variable values for builds invoked by push and pull events, and can be used to access the JSON payload when your source code is in GitHub repositories or Cloud Source Repositories.

You can use the payload bindings and user defined substitutions to parse the payload info.