Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Merge branch 'next' into some-tweaks

Kanamee689be552b6c
diff --cc apps/api/src/lib/common.ts
index 5bb2aa1340,857bb19103..337d276822
--- a/apps/api/src/lib/common.ts
+++ b/apps/api/src/lib/common.ts
@@@ -70,54 -68,43 +70,56 @@@ const otherTraefikEndpoint = isDe
? `${getAPIUrl()}/webhooks/traefik/other.json`
: 'http://coolify:3000/webhooks/traefik/other.json';
-
export const uniqueName = (): string => uniqueNamesGenerator(customConfig);
export const asyncExecShell = util.promisify(exec);
-export const asyncExecShellStream = async ({ debug, buildId, applicationId, command, engine }: { debug: boolean, buildId: string, applicationId: string, command: string, engine: string }) => {
+export const asyncExecShellStream = async ({
+ debug,
+ buildId,
+ applicationId,
+ command,
+ engine
+}: {
+ debug: boolean;
+ buildId: string;
+ applicationId: string;
+ command: string;
+ engine: string;
+}) => {
return await new Promise(async (resolve, reject) => {
- const { execaCommand } = await import('execa')
- const subprocess = execaCommand(command, { env: { DOCKER_BUILDKIT: "1", DOCKER_HOST: engine } })
- const errorLogs = []
- const logs = []
+ const { execaCommand } = await import('execa');
+ const subprocess = execaCommand(command, {
+ env: { DOCKER_BUILDKIT: '1', DOCKER_HOST: engine }
+ });
+ if (debug) {
subprocess.stdout.on('data', async (data) => {
const stdout = data.toString();
- const array = stdout.split('\n')
+ const array = stdout.split('\n');
for (const line of array) {
if (line !== '\n' && line !== '') {
- await saveBuildLog({
+ logs.push(line.replace('\n', ''))
+ debug && await saveBuildLog({
line: `${line.replace('\n', '')}`,
buildId,
applicationId
});
}
}
- })
+ });
subprocess.stderr.on('data', async (data) => {
const stderr = data.toString();
- const array = stderr.split('\n')
+ const array = stderr.split('\n');
for (const line of array) {
if (line !== '\n' && line !== '') {
- await saveBuildLog({
+ errorLogs.push(line.replace('\n', ''))
+ debug && await saveBuildLog({
line: `${line.replace('\n', '')}`,
buildId,
applicationId
- });
+ });
}
}
- })
+ });
+ }
subprocess.on('exit', async (code) => {
await asyncSleep(1000);
if (code === 0) {