Report a deployment
Report a deployment from the pipeline once it finishes, passing the deployed SHA, the repository, the environment and the service. The organization and the repository must have post-deploy verification enabled, and service must name one of the services configured for it. Gitar records the deployment and checks production logs for every pull request it shipped 15 minutes, 30 minutes, 1 hour, 1 day and 3 days after deployed_at.
Gitar measures each deployment from the previous one it recorded for the same repository, environment and service, so the pipeline does not need to know what was deployed before. The first deployment to an environment only checks the pull request that landed as sha. Pass base_sha to measure from a specific commit instead.
One deployment verifies at most 100 pull requests. Without base_sha, a larger range or one Gitar cannot resolve verifies the newest 100 merged since the previous deployment and up to sha, skipping any an earlier deployment in the stream shipped. With base_sha, the same cases return 400.
SHAs may be full or abbreviated to at least 7 hex characters. Reporting the latest deployment’s SHA again is treated as a retry and returns the same deployment.
The repository is resolved within the token’s organization, so one the token cannot see returns 404.
A 202 confirms the deployment was recorded and its pull requests are scheduled for verification. It does not mean monitoring has started, and queued is empty when the deployment shipped no reviewed pull request.
403.Prerequisites
Example
Repository owner and name
Setrepo_owner and repo_name using the code host’s identifiers:
gitlab.com/acme/platform/worker has repo_owner acme/platform and repo_name worker.
See the setup guide for GitHub Actions and GitLab CI examples.
Errors
sha as the latest deployment in the stream returns that deployment rather than recording a new one, so a pipeline can retry safely.Authorizations
Body
One deployment of one repository to one environment.
Response
Deployment recorded and its pull requests queued for verification