The Simplest Way to Make Google Pub/Sub and Teamcity Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair google pub/sub and teamcity to trigger builds from cloud events in real time. This workflow sends build status updates and deploy signals across cloud apps without manual work. Cloud apps publish messages to a topic when code changes or data jobs finish. Your build server reads those events or pushes its own build results back out. This link removes slow polling loops and keeps release pipelines fast and clean. How google pub/sub and teamcity pass identity and data Data moves betw

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams pair google pub/sub and teamcity to trigger builds from cloud events in real time. This workflow sends build status updates and deploy signals across cloud apps without manual work.

Cloud apps publish messages to a topic when code changes or data jobs finish. Your build server reads those events or pushes its own build results back out. This link removes slow polling loops and keeps release pipelines fast and clean.

How google pub/sub and teamcity pass identity and data

Data moves between these two tools in two main directions during a build cycle. First, the build server can send status events to a cloud topic after each job. Second, a cloud topic can wake up a build agent when an external event arrives.

To make this work, the build server needs a valid cloud identity with clear rules. Teams create a dedicated cloud service account for the build system to use. That account holds a role that only allows publishing or reading on one named topic.

Workload identity federation is the safest way to log in from your build agents. It trades a short build token for a temporary cloud key during the job run. You do not need to store static JSON keys inside your build project settings.

When a build step starts, the agent requests a short token for that single job. It sends the payload to the topic and drops the key when the job ends. Downstream workers read the message and start their own tasks right away.

Common failure modes and how to scope roles

The biggest risk in this setup is a shared service account with broad project roles. Many teams give one static key to every build project to save setup time. If one build script leaks that key, an attacker can read every cloud topic.

Broad keys also ruin your audit logs when something breaks in production. Every message looks like it came from the same generic build user in the logs. You cannot tell which pipeline or developer pushed a bad event to the queue.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Another common issue is unlogged message payloads that carry secret data or raw user details. Build logs or status messages might include emails, phone numbers, or card numbers by mistake. Once that data enters a message topic, many other apps might read and store it.

To fix this, give each build project its own cloud service account and tight role. Scope each role to a single topic or subscription instead of the whole cloud project. Separate your test build topics from your prod topics so test jobs stay isolated.

Next, lock down the network path between your build agents and the cloud APIs. Run your build agents inside a private network with strict outbound traffic rules. Use private cloud endpoints so message traffic never crosses the public internet.

Keeping build queues fast and reliable

Message queues and build servers run at very different speeds during peak hours. A cloud topic can take in thousands of events in a single second. Your build agents can only run a set number of jobs at the same time.

If you push every raw event straight to the build server, the queue will jam. Set up message filters on your subscription to drop events that do not need builds. You can also batch small events together before waking up a build agent.

Always set a dead-letter topic for build messages that fail to process after a few tries. This keeps bad payloads from blocking new builds while your team checks the error logs.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

How should build agents log in to Google Cloud?

Use workload identity federation instead of long-lived JSON service account keys. This setup gives each build job a short token that expires right after the run.

How do we stop test builds from sending events to prod topics?

Create separate service accounts for test and prod build projects in your cloud account. Grant the test account write permissions only on your test topics.

What happens if a build message holds sensitive user data?

Keep raw data out of build events and only pass small job IDs in messages. Data masking can also rewrite emails, phone numbers, or national IDs in results.

The query runs. The emails stay hidden.