feat: deploy all stacks to shared ai-stack-portal project
- Add SHARED_PROJECT_ID and SHARED_ENVIRONMENT_ID env vars - Add findApplicationByName to Dokploy client for app-based lookup - Update production-deployer to use shared project instead of creating new ones - Update name availability check to query apps in shared environment - Update delete endpoint to remove apps from shared project - Rollback no longer deletes shared project (only app/domain) - Backward compatible: falls back to per-project if env vars not set
This commit is contained in:
@@ -408,6 +408,22 @@ export class DokployProductionClient {
|
||||
);
|
||||
}
|
||||
|
||||
async getApplicationsByEnvironmentId(environmentId: string): Promise<DokployApplication[]> {
|
||||
const env = await this.request<{ applications: DokployApplication[] }>(
|
||||
'GET',
|
||||
`/environment.one?environmentId=${environmentId}`,
|
||||
undefined,
|
||||
'environment',
|
||||
'get-apps'
|
||||
);
|
||||
return env.applications || [];
|
||||
}
|
||||
|
||||
async findApplicationByName(environmentId: string, name: string): Promise<DokployApplication | null> {
|
||||
const apps = await this.getApplicationsByEnvironmentId(environmentId);
|
||||
return apps.find(a => a.name === name) || null;
|
||||
}
|
||||
|
||||
async createDomain(
|
||||
host: string,
|
||||
applicationId: string,
|
||||
|
||||
Reference in New Issue
Block a user