Inject commit-based image tags for Docker Compose build services

For Docker Compose applications with build directives, inject commit-based
image tags (uuid_servicename:commit) to enable rollback functionality.
Previously these services always used 'latest' tags, making rollback impossible.

- Only injects tags for services with build: but no explicit image:
- Uses pr-{id} tags for pull request deployments
- Respects user-defined image: fields (preserves user intent)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2025-12-05 11:41:47 +01:00
parent 710dc3ca4b
commit 439afca642
4 changed files with 189 additions and 4 deletions

View File

@@ -1500,10 +1500,10 @@ class Application extends BaseModel
instant_remote_process($commands, $this->destination->server, false);
}
public function parse(int $pull_request_id = 0, ?int $preview_id = null)
public function parse(int $pull_request_id = 0, ?int $preview_id = null, ?string $commit = null)
{
if ((int) $this->compose_parsing_version >= 3) {
return applicationParser($this, $pull_request_id, $preview_id);
return applicationParser($this, $pull_request_id, $preview_id, $commit);
} elseif ($this->docker_compose_raw) {
return parseDockerComposeFile(resource: $this, isNew: false, pull_request_id: $pull_request_id, preview_id: $preview_id);
} else {