Enhance Coolify API deployment with improved gateway route handling and extensive test coverage. Add new methods for service updates and ensure Composer vendor sanity checks in PHP container.
This commit is contained in:
@@ -200,6 +200,38 @@ it('creates Coolify GitHub App application payloads so pulls use the app token',
|
||||
expect($payload)->not->toHaveKey('docker_compose_raw');
|
||||
});
|
||||
|
||||
it('uses the self-contained Coolify API Dockerfile for API applications', function (): void {
|
||||
$manager = new release_manager();
|
||||
$payloadMethod = new ReflectionMethod(release_manager::class, 'releaseCoolifyApplicationPayload');
|
||||
$payloadMethod->setAccessible(true);
|
||||
|
||||
$payload = $payloadMethod->invoke($manager, [
|
||||
'channel_slug' => 'internal',
|
||||
'app' => 'api',
|
||||
'repository' => 'copenhagentruckwash/api',
|
||||
'branch' => 'master',
|
||||
'auto_deploy' => 1,
|
||||
], [
|
||||
'coolify_service_name' => 'release-internal-api-node3-truckwash-io',
|
||||
'coolify_project_uuid' => 'project-internal',
|
||||
'coolify_github_app_uuid' => 'github-app-copenhagentruckwash-github',
|
||||
'coolify_deploy_now' => true,
|
||||
'coolify_public_url' => 'https://api-v2.truckwash.io',
|
||||
'coolify_enable_ssl' => true,
|
||||
'gateway_route_autoprovision' => true,
|
||||
], [
|
||||
'default_environment_name' => 'production',
|
||||
'default_server_uuid' => 'server-node3',
|
||||
]);
|
||||
|
||||
expect($payload['build_pack'])->toBe('dockerfile');
|
||||
expect($payload['ports_exposes'])->toBe('80');
|
||||
expect($payload['dockerfile_location'])->toBe('/Dockerfile.coolify-api');
|
||||
expect($payload['domains'])->toBe('https://api-v2.truckwash.io:80');
|
||||
expect($payload)->not->toHaveKey('publish_directory');
|
||||
expect($payload)->not->toHaveKey('is_static');
|
||||
});
|
||||
|
||||
it('builds explicit Coolify application route labels for release API targets', function (): void {
|
||||
$manager = new release_manager();
|
||||
$payloadMethod = new ReflectionMethod(release_manager::class, 'releaseCoolifyApplicationRoutePayload');
|
||||
@@ -215,7 +247,7 @@ it('builds explicit Coolify application route labels for release API targets', f
|
||||
], 'https://api-v2.truckwash.io', 'api-app-uuid', base64_encode('custom.keep=true'));
|
||||
$labels = explode("\n", base64_decode($payload['custom_labels'], true));
|
||||
|
||||
expect($payload['domains'])->toBe('https://api-v2.truckwash.io')
|
||||
expect($payload['domains'])->toBe('https://api-v2.truckwash.io:8080')
|
||||
->and($payload['is_force_https_enabled'])->toBeTrue()
|
||||
->and($payload['force_domain_override'])->toBeTrue()
|
||||
->and($labels)->toContain('custom.keep=true')
|
||||
|
||||
Reference in New Issue
Block a user