feat: version selection for runtimes and databases
Backend: - Add runtimeVersion, phpVersion, dbVersion columns to Application entity - Add version fields to CreateApplicationDto with validation - Node.js Dockerfile: use selected version (22/20/18/16) instead of hardcoded 20 - Laravel Dockerfile: use selected PHP version (8.4/8.3/8.2/8.1) instead of 8.3 - WordPress Dockerfile: use selected WP version (6.7/6.6/6.5/6.4) + PHP version - K8s deployDatabase(): use selected DB version instead of hardcoded postgres:16/mysql:8.0 - K8s restoreDatabaseDump(): match DB image version for restore jobs - Add dbVersion to ManifestContext interface Frontend: - Add runtimeVersion, phpVersion, dbVersion to Application and CreateApplicationDto - Deploy page: Node.js version dropdown (22/20/18/16) - Deploy page: Laravel PHP version dropdown (8.4/8.3/8.2/8.1) - Deploy page: WordPress version + PHP version dropdowns - Deploy page: PostgreSQL version dropdown (17/16/15/14) - Deploy page: MySQL version dropdown (9.0/8.4/8.0/5.7) - Deploy page: auto-set default versions on runtime/DB selection - Review step: show selected versions - App detail page: display runtime + DB versions in config and header
This commit is contained in:
@@ -25,6 +25,7 @@ interface ManifestContext {
|
||||
subdomain: string;
|
||||
dbUsername: string;
|
||||
dbPassword: string;
|
||||
dbVersion: string;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
@@ -97,6 +98,7 @@ export class KubernetesService implements OnModuleInit {
|
||||
subdomain: app.subdomain || app.name,
|
||||
dbUsername: app.dbUsername || 'appuser',
|
||||
dbPassword: app.dbPassword || this.generatePassword(),
|
||||
dbVersion: app.dbVersion || '',
|
||||
};
|
||||
|
||||
const manifests: Record<string, any> = {};
|
||||
@@ -398,7 +400,9 @@ export class KubernetesService implements OnModuleInit {
|
||||
|
||||
// Deploy database
|
||||
const isPostgres = ctx.databaseType === DatabaseType.POSTGRESQL;
|
||||
const image = isPostgres ? 'postgres:16-alpine' : 'mysql:8.0';
|
||||
const defaultDbVersion = isPostgres ? '16' : '8.0';
|
||||
const dbVer = ctx.dbVersion || defaultDbVersion;
|
||||
const image = isPostgres ? `postgres:${dbVer}-alpine` : `mysql:${dbVer}`;
|
||||
const port = isPostgres ? 5432 : 3306;
|
||||
const envVars = isPostgres
|
||||
? [
|
||||
@@ -902,7 +906,9 @@ export class KubernetesService implements OnModuleInit {
|
||||
`mysql -h ${dbName} -u "$DB_USER" -p"$DB_PASSWORD" ${dbDatabase} < /dump/dump.sql 2>&1`,
|
||||
];
|
||||
|
||||
const image = isPostgres ? 'postgres:16-alpine' : 'mysql:8.0';
|
||||
const defaultRestoreDbVer = isPostgres ? '16' : '8.0';
|
||||
const restoreDbVer = app.dbVersion || defaultRestoreDbVer;
|
||||
const image = isPostgres ? `postgres:${restoreDbVer}-alpine` : `mysql:${restoreDbVer}`;
|
||||
|
||||
// 3. Create the restore Job
|
||||
const job: k8s.V1Job = {
|
||||
|
||||
Reference in New Issue
Block a user