hm
This commit is contained in:
parent
221dcefd6c
commit
35625b22f5
@ -13,7 +13,6 @@ export async function migrateServicesToNewTemplate(templates: any) {
|
||||
}
|
||||
let template = templates.find(t => t.name.toLowerCase() === service.type.toLowerCase());
|
||||
if (template) {
|
||||
console.log(template.variables.find(v => v.name === "_APP_REDIS_HOST"))
|
||||
template = JSON.parse(JSON.stringify(template).replaceAll('$$id', service.id))
|
||||
if (service.type === 'plausibleanalytics' && service.plausibleAnalytics) await plausibleAnalytics(service, template)
|
||||
if (service.type === 'fider' && service.fider) await fider(service, template)
|
||||
|
@ -700,11 +700,11 @@ export async function startService(request: FastifyRequest<ServiceStartStop>) {
|
||||
const network = destinationDockerId && destinationDocker.network;
|
||||
const config = {};
|
||||
for (const service in template.services) {
|
||||
let newEnviroments = []
|
||||
let newEnvironments = []
|
||||
for (const environment of template.services[service].environment) {
|
||||
const [env, value] = environment.split("=");
|
||||
if (!value.startsWith('$$secret') && value !== '') {
|
||||
newEnviroments.push(`${env}=${value}`)
|
||||
newEnvironments.push(`${env}=${value}`)
|
||||
}
|
||||
|
||||
}
|
||||
@ -712,8 +712,8 @@ export async function startService(request: FastifyRequest<ServiceStartStop>) {
|
||||
for (const secret of secrets) {
|
||||
const { name, value } = secret
|
||||
if (value) {
|
||||
if (template.services[service].environment.find(env => env.startsWith(`${name}=`)) && !newEnviroments.find(env => env.startsWith(`${name}=`))) {
|
||||
newEnviroments.push(`${name}=${decrypt(value)}`)
|
||||
if (template.services[service].environment.find(env => env.startsWith(`${name}=`)) && !newEnvironments.find(env => env.startsWith(`${name}=`))) {
|
||||
newEnvironments.push(`${name}=${decrypt(value)}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -726,7 +726,7 @@ export async function startService(request: FastifyRequest<ServiceStartStop>) {
|
||||
expose: template.services[service].ports,
|
||||
// ...(exposePort ? { ports: [`${exposePort}:${port}`] } : {}),
|
||||
volumes: template.services[service].volumes,
|
||||
environment: newEnviroments,
|
||||
environment: newEnvironments,
|
||||
depends_on: template.services[service]?.depends_on,
|
||||
ulimits: template.services[service]?.ulimits,
|
||||
cap_drop: template.services[service]?.cap_drop,
|
||||
@ -766,6 +766,7 @@ export async function startService(request: FastifyRequest<ServiceStartStop>) {
|
||||
volumes: volumeMounts
|
||||
}
|
||||
const composeFileDestination = `${workdir}/docker-compose.yaml`;
|
||||
console.log(composeFileDestination)
|
||||
await fs.writeFile(composeFileDestination, yaml.dump(composeFile));
|
||||
await startServiceContainers(destinationDocker.id, composeFileDestination)
|
||||
return {}
|
||||
|
Loading…
Reference in New Issue
Block a user