fix: Only restart coolify proxy in case of version prior to 2.9.2

This commit is contained in:
Andras Bacsai
2022-05-31 20:25:39 +02:00
parent 67bb5d973b
commit a7aca0ce8b
2 changed files with 15 additions and 8 deletions

View File

@@ -6,7 +6,6 @@ import * as db from '$lib/database';
import type { RequestHandler } from '@sveltejs/kit';
import compare from 'compare-versions';
import got from 'got';
import { checkContainer, startCoolifyProxy, startTraefikProxy } from '$lib/haproxy';
export const get: RequestHandler = async (request) => {
try {
@@ -44,12 +43,6 @@ export const post: RequestHandler = async (event) => {
await asyncExecShell(
`sed -i '/COOLIFY_AUTO_UPDATE=/c\COOLIFY_AUTO_UPDATE=${settings.isAutoUpdateEnabled}' .env`
);
// TODO: Remove this after release
try {
await asyncExecShell(
`docker run --rm -tid --env-file .env -v /var/run/docker.sock:/var/run/docker.sock -v coolify-db coollabsio/coolify:${latestVersion} /bin/sh -c "docker stop -t 0 coolify-proxy && docker rm coolify-proxy"`
);
} catch (error) {}
await asyncExecShell(
`docker run --rm -tid --env-file .env -v /var/run/docker.sock:/var/run/docker.sock -v coolify-db coollabsio/coolify:${latestVersion} /bin/sh -c "env | grep COOLIFY > .env && echo 'TAG=${latestVersion}' >> .env && docker stop -t 0 coolify coolify-redis && docker rm coolify coolify-redis && docker compose up -d --force-recreate"`
);