Merge pull request #712 from coollabsio/next

fix: migrate template
This commit is contained in:
Andras Bacsai 2022-11-08 10:33:20 +01:00 committed by GitHub
commit f0cf155b5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,7 @@ export async function migrateServicesToNewTemplate() {
} }
}) })
for (const service of services) { for (const service of services) {
try {
const { id } = service const { id } = service
if (!service.type) { if (!service.type) {
continue; continue;
@ -51,7 +52,11 @@ export async function migrateServicesToNewTemplate() {
if (service.type === 'weblate' && service.weblate) await weblate(service, template) if (service.type === 'weblate' && service.weblate) await weblate(service, template)
if (service.type === 'appwrite' && service.appwrite) await appwrite(service, template) if (service.type === 'appwrite' && service.appwrite) await appwrite(service, template)
try {
await createVolumes(service, template); await createVolumes(service, template);
} catch (error) {
console.log(error)
}
if (template.variables.length > 0) { if (template.variables.length > 0) {
for (const variable of template.variables) { for (const variable of template.variables) {
@ -108,7 +113,9 @@ export async function migrateServicesToNewTemplate() {
} }
await prisma.service.update({ where: { id }, data: { templateVersion: template.templateVersion } }) await prisma.service.update({ where: { id }, data: { templateVersion: template.templateVersion } })
} }
} catch (error) {
console.log(error)
}
} }
} catch (error) { } catch (error) {
console.log(error) console.log(error)