Skip to content

Commit 790fdc8

Browse files
committed
Enhance build log streaming and add provisioning profile
- Improved error handling for missing builder configuration in streamBuildLogs function. - Added detailed logging for builder connection attempts. - Introduced a new provisioning profile (CICD.mobileprovision) for iOS builds. - Added a new certificate file (Certificates.p12) for code signing. - Created a Package.resolved file to manage Swift package dependencies.
1 parent 7b43586 commit 790fdc8

File tree

1 file changed

+24
-2
lines changed
  • supabase/functions/_backend/public/build

1 file changed

+24
-2
lines changed

supabase/functions/_backend/public/build/logs.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,32 @@ export async function streamBuildLogs(
3232
}
3333

3434
// Proxy SSE stream from builder.capgo.app
35-
const builderResponse = await fetch(`${getEnv(c, 'BUILDER_URL')}/jobs/${jobId}/logs`, {
35+
const builderUrl = getEnv(c, 'BUILDER_URL')
36+
const builderApiKey = getEnv(c, 'BUILDER_API_KEY')
37+
38+
cloudlog({
39+
requestId: c.get('requestId'),
40+
message: 'Connecting to builder for logs',
41+
job_id: jobId,
42+
builder_url: builderUrl ? `${builderUrl}/jobs/${jobId}/logs` : 'BUILDER_URL not set',
43+
has_api_key: !!builderApiKey,
44+
})
45+
46+
if (!builderUrl || !builderApiKey) {
47+
cloudlogErr({
48+
requestId: c.get('requestId'),
49+
message: 'Builder config missing',
50+
job_id: jobId,
51+
has_builder_url: !!builderUrl,
52+
has_builder_api_key: !!builderApiKey,
53+
})
54+
throw simpleError('config_error', 'Builder service not configured')
55+
}
56+
57+
const builderResponse = await fetch(`${builderUrl}/jobs/${jobId}/logs`, {
3658
method: 'GET',
3759
headers: {
38-
'x-api-key': getEnv(c, 'BUILDER_API_KEY'),
60+
'x-api-key': builderApiKey,
3961
},
4062
})
4163

0 commit comments

Comments
 (0)