Use Dockerfile builds for frontend release targets
This commit is contained in:
@@ -373,6 +373,52 @@ it('builds gateway API auto-provision context for connected Coolify servers', fu
|
||||
expect($context)->not->toHaveKey('coolify_start_command');
|
||||
});
|
||||
|
||||
it('builds gateway frontend auto-provision context with the release Dockerfile', function (): void {
|
||||
$manager = new coolify_manager();
|
||||
$contextMethod = new ReflectionMethod(coolify_manager::class, 'gatewayRouteProvisionDeployContext');
|
||||
$contextMethod->setAccessible(true);
|
||||
|
||||
$server = [
|
||||
'uuid' => 'server-node3',
|
||||
'name' => 'node3.truckwash.io',
|
||||
'public_ip' => '23.88.23.183',
|
||||
'settings' => ['is_reachable' => true, 'is_usable' => true],
|
||||
];
|
||||
|
||||
$context = $contextMethod->invoke($manager, [
|
||||
'id' => 43,
|
||||
'channel_slug' => 'internal',
|
||||
'app' => 'frontend',
|
||||
'deploy_context_json' => json_encode([
|
||||
'coolify_project_uuid' => 'project-internal',
|
||||
'coolify_build_pack' => 'static',
|
||||
'coolify_install_command' => 'npm ci',
|
||||
'coolify_build_command' => 'npm run build',
|
||||
'coolify_publish_directory' => 'dist',
|
||||
'coolify_is_static' => true,
|
||||
'coolify_is_spa' => true,
|
||||
]),
|
||||
], $server, '23.88.23.183', 'api-v2.truckwash.io', 'https://api-v2.truckwash.io/internal/frontend');
|
||||
|
||||
expect($context)->toMatchArray([
|
||||
'coolify_project_uuid' => 'project-internal',
|
||||
'coolify_build_pack' => 'dockerfile',
|
||||
'coolify_dockerfile_location' => '/Dockerfile.coolify-frontend',
|
||||
'coolify_ports_exposes' => '80',
|
||||
'coolify_port' => '80',
|
||||
'coolify_public_url' => 'https://api-v2.truckwash.io/internal/frontend',
|
||||
'coolify_server_uuid' => 'server-node3',
|
||||
'coolify_service_name' => 'release-internal-frontend-node3-truckwash-io',
|
||||
'gateway_route_autoprovision' => true,
|
||||
'gateway_route_source_target_id' => 43,
|
||||
'gateway_route_target_ip' => '23.88.23.183',
|
||||
]);
|
||||
expect($context)->not->toHaveKey('coolify_install_command');
|
||||
expect($context)->not->toHaveKey('coolify_publish_directory');
|
||||
expect($context)->not->toHaveKey('coolify_is_static');
|
||||
expect($context)->not->toHaveKey('coolify_is_spa');
|
||||
});
|
||||
|
||||
it('adds explicit Coolify application route labels for gateway API domains', function (): void {
|
||||
$payloadMethod = new ReflectionMethod(coolify_manager::class, 'gatewayRouteApplicationPayload');
|
||||
$payloadMethod->setAccessible(true);
|
||||
|
||||
Reference in New Issue
Block a user