mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-12 14:14:52 +00:00
fix(deployment): avoid shared preview tags for HEAD commits
Use the deployment UUID when preview deployments are built from HEAD so each deployment gets distinct production and build image tags.
This commit is contained in:
1 parent
2253c40e01
commit
9bb40f3ccb
4 files changed
+53
-34
No files matched your search
@@ -1184,7 +1184,11 @@ class ApplicationDeploymentJob implements ShouldBeEncrypted, ShouldQueue
|
||||
$prefix = "pr-{$this->pull_request_id}-";
|
||||
$suffix = $build ? '-build' : '';
|
||||
$maxCommitLength = max(1, 128 - strlen($prefix) - strlen($suffix));
|
||||
$commit = Str::of($this->commit ?: 'HEAD')
|
||||
$commitSource = ($this->commit === 'HEAD' || blank($this->commit))
|
||||
? $this->deployment_uuid
|
||||
: $this->commit;
|
||||
|
||||
$commit = Str::of($commitSource)
|
||||
->replaceMatches('/[^A-Za-z0-9_.-]/', '-')
|
||||
->substr(0, $maxCommitLength)
|
||||
->toString();
|
||||
|
||||
Reference in new issue
Block a user