Pin gateway auto-provision deployments to source commit
This commit is contained in:
@@ -1926,13 +1926,14 @@ class coolify_manager
|
||||
], $actorUserId);
|
||||
}
|
||||
|
||||
$deployment = $releaseManager->startDeployment([
|
||||
$sourceCommitSha = trim((string)($sourceTarget['latest_deployment_commit_sha'] ?? ''));
|
||||
$deploymentInput = [
|
||||
'target_id' => (int)($deploymentTarget['id'] ?? 0),
|
||||
'channel_id' => (int)$sourceTarget['channel_id'],
|
||||
'app' => $app,
|
||||
'repository' => (string)($sourceTarget['repository'] ?? ''),
|
||||
'branch' => (string)($sourceTarget['branch'] ?? 'master'),
|
||||
'commit_mode' => 'latest',
|
||||
'commit_mode' => $sourceCommitSha === '' ? 'latest' : 'specific',
|
||||
'version_label' => $this->gatewayRouteProvisionVersionLabel($sourceTarget),
|
||||
'deployed_url' => $sourcePublicUrl,
|
||||
'metadata' => [
|
||||
@@ -1942,7 +1943,11 @@ class coolify_manager
|
||||
'server_uuid' => $serverUuid,
|
||||
'app' => $app,
|
||||
],
|
||||
], $actorUserId);
|
||||
];
|
||||
if ($sourceCommitSha !== '') {
|
||||
$deploymentInput['commit_sha'] = $sourceCommitSha;
|
||||
}
|
||||
$deployment = $releaseManager->startDeployment($deploymentInput, $actorUserId);
|
||||
|
||||
if ((string)($deployment['status'] ?? '') !== 'deployed') {
|
||||
$errors[] = array_replace($action, [
|
||||
|
||||
@@ -611,6 +611,8 @@ it('defines Coolify schema, route permissions, and replication integration hooks
|
||||
expect($manager)->toContain('gateway_route_autoprovision');
|
||||
expect($manager)->toContain('upsertDeploymentTarget');
|
||||
expect($manager)->toContain('startDeployment');
|
||||
expect($manager)->toContain("'commit_mode' => \$sourceCommitSha === '' ? 'latest' : 'specific'");
|
||||
expect($manager)->toContain("\$deploymentInput['commit_sha'] = \$sourceCommitSha;");
|
||||
expect($manager)->toContain('verifyGatewayRoutes');
|
||||
expect($manager)->toContain('bootstrapGatewayCertificates');
|
||||
expect($manager)->toContain('setLoadBalancerIpTargets');
|
||||
|
||||
Reference in New Issue
Block a user