feat(devops,docs,verify): implement Phase 4 CI pipeline, OpenAPI synchronization, and E2E verification matrix
Deploy Canina / deploy (push) Failing after 28s
Deploy Canina / deploy (push) Failing after 28s
This commit is contained in:
1 parent
27abaa3e05
commit
ad3f149789
25 files changed
+3582
-212
No files matched your search
@@ -0,0 +1,46 @@
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { AppModule } from '../src/app.module';
|
||||
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
import * as yaml from 'js-yaml';
|
||||
|
||||
async function generateOpenApi() {
|
||||
process.env.JWT_ACCESS_SECRET =
|
||||
process.env.JWT_ACCESS_SECRET ||
|
||||
'test_access_secret_32_characters_minimum_entropy';
|
||||
process.env.JWT_REFRESH_SECRET =
|
||||
process.env.JWT_REFRESH_SECRET ||
|
||||
'test_refresh_secret_32_characters_minimum_entropy';
|
||||
|
||||
const app = await NestFactory.create(AppModule, { logger: false });
|
||||
|
||||
app.setGlobalPrefix('api');
|
||||
|
||||
const config = new DocumentBuilder()
|
||||
.setTitle('Canino Iran API')
|
||||
.setDescription(
|
||||
'API Documentation for Canino Iran Pet Health & Supplement Platform',
|
||||
)
|
||||
.setVersion('1.0.0')
|
||||
.addBearerAuth()
|
||||
.build();
|
||||
|
||||
const document = SwaggerModule.createDocument(app, config);
|
||||
|
||||
const yamlContent = yaml.dump(document, { noRefs: true, lineWidth: -1 });
|
||||
|
||||
const rootSwaggerPath = path.resolve(__dirname, '../../swagger.yml');
|
||||
fs.writeFileSync(rootSwaggerPath, yamlContent, 'utf8');
|
||||
|
||||
console.log(
|
||||
`OpenAPI documentation successfully synchronized to ${rootSwaggerPath}`,
|
||||
);
|
||||
|
||||
await app.close();
|
||||
}
|
||||
|
||||
generateOpenApi().catch((err) => {
|
||||
console.error('Error generating OpenAPI spec:', err);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in new issue
Block a user