Files
coolify/src/routes/api/v1/upgrade/index.ts
Andras Bacsai adcd68c1ab v1.0.13 (#46)
2021-05-16 21:54:44 +02:00

20 lines
641 B
TypeScript

import { saveServerLog } from '$lib/api/applications/logging';
import { execShellAsync } from '$lib/api/common';
import type { Request } from '@sveltejs/kit';
export async function get(request: Request) {
const upgradeP1 = await execShellAsync(
'bash -c "$(curl -fsSL https://get.coollabs.io/coolify/upgrade-p1.sh)"'
);
await saveServerLog({ message: upgradeP1, type: 'UPGRADE-P-1' });
execShellAsync(
'docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -u root coolify bash -c "$(curl -fsSL https://get.coollabs.io/coolify/upgrade-p2.sh)"'
);
return {
status: 200,
body: {
message: "I'm trying, okay?"
}
};
}