commit
3421de06d5
@ -28,6 +28,10 @@ import * as buildpacks from '../lib/buildPacks';
|
|||||||
parentPort.postMessage({ size: queue.size, pending: queue.pending, caller: 'cleanupStorage' });
|
parentPort.postMessage({ size: queue.size, pending: queue.pending, caller: 'cleanupStorage' });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (message === 'action:flushQueue') {
|
||||||
|
queue.clear()
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await queue.add(async () => {
|
await queue.add(async () => {
|
||||||
const {
|
const {
|
||||||
@ -330,8 +334,8 @@ import * as buildpacks from '../lib/buildPacks';
|
|||||||
await saveBuildLog({ line: 'Deployment successful!', buildId, applicationId });
|
await saveBuildLog({ line: 'Deployment successful!', buildId, applicationId });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await saveBuildLog({ line: error, buildId, applicationId });
|
await saveBuildLog({ line: error, buildId, applicationId });
|
||||||
await prisma.build.update({
|
await prisma.build.updateMany({
|
||||||
where: { id: message.build_id },
|
where: { id: message.build_id, status: { in: ['queued', 'running'] } },
|
||||||
data: { status: 'failed' }
|
data: { status: 'failed' }
|
||||||
});
|
});
|
||||||
throw new Error(error);
|
throw new Error(error);
|
||||||
@ -346,8 +350,8 @@ import * as buildpacks from '../lib/buildPacks';
|
|||||||
|
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
await prisma.build.update({
|
await prisma.build.updateMany({
|
||||||
where: { id: message.build_id },
|
where: { id: message.build_id, status: { in: ['queued', 'running'] } },
|
||||||
data: { status: 'failed' }
|
data: { status: 'failed' }
|
||||||
});
|
});
|
||||||
await saveBuildLog({ line: error, buildId, applicationId });
|
await saveBuildLog({ line: error, buildId, applicationId });
|
||||||
|
@ -551,6 +551,10 @@ export async function buildImage({
|
|||||||
const dockerFile = isCache ? `${dockerFileLocation}-cache` : `${dockerFileLocation}`
|
const dockerFile = isCache ? `${dockerFileLocation}-cache` : `${dockerFileLocation}`
|
||||||
const cache = `${applicationId}:${tag}${isCache ? '-cache' : ''}`
|
const cache = `${applicationId}:${tag}${isCache ? '-cache' : ''}`
|
||||||
await executeDockerCmd({ debug, buildId, applicationId, dockerId, command: `docker build --progress plain -f ${workdir}/${dockerFile} -t ${cache} ${workdir}` })
|
await executeDockerCmd({ debug, buildId, applicationId, dockerId, command: `docker build --progress plain -f ${workdir}/${dockerFile} -t ${cache} ${workdir}` })
|
||||||
|
const { status } = await prisma.build.findUnique({ where: { id: buildId } })
|
||||||
|
if (status === 'canceled') {
|
||||||
|
throw new Error('Build canceled.')
|
||||||
|
}
|
||||||
if (isCache) {
|
if (isCache) {
|
||||||
await saveBuildLog({ line: `Building cache image successful.`, buildId, applicationId });
|
await saveBuildLog({ line: `Building cache image successful.`, buildId, applicationId });
|
||||||
} else {
|
} else {
|
||||||
|
@ -17,8 +17,9 @@ import { checkContainer, removeContainer } from './docker';
|
|||||||
import { day } from './dayjs';
|
import { day } from './dayjs';
|
||||||
import * as serviceFields from './serviceFields'
|
import * as serviceFields from './serviceFields'
|
||||||
import { saveBuildLog } from './buildPacks/common';
|
import { saveBuildLog } from './buildPacks/common';
|
||||||
|
import { scheduler } from './scheduler';
|
||||||
|
|
||||||
export const version = '3.8.0';
|
export const version = '3.8.1';
|
||||||
export const isDev = process.env.NODE_ENV === 'development';
|
export const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
const algorithm = 'aes-256-ctr';
|
const algorithm = 'aes-256-ctr';
|
||||||
@ -1873,12 +1874,16 @@ export async function stopBuild(buildId, applicationId) {
|
|||||||
const { engine, id: dockerId } = await prisma.destinationDocker.findFirst({ where: { id: destinationDockerId } });
|
const { engine, id: dockerId } = await prisma.destinationDocker.findFirst({ where: { id: destinationDockerId } });
|
||||||
const interval = setInterval(async () => {
|
const interval = setInterval(async () => {
|
||||||
try {
|
try {
|
||||||
if (status === 'failed') {
|
if (status === 'failed' || status === 'canceled') {
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
return resolve();
|
return resolve();
|
||||||
}
|
}
|
||||||
if (count > 50) {
|
if (count > 15) {
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
|
if (scheduler.workers.has('deployApplication')) {
|
||||||
|
scheduler.workers.get('deployApplication').postMessage("action:flushQueue")
|
||||||
|
}
|
||||||
|
await cleanupDB(buildId);
|
||||||
return reject(new Error('Build canceled'));
|
return reject(new Error('Build canceled'));
|
||||||
}
|
}
|
||||||
const { stdout: buildContainers } = await executeDockerCmd({ dockerId, command: `docker container ls --filter "label=coolify.buildId=${buildId}" --format '{{json .}}'` })
|
const { stdout: buildContainers } = await executeDockerCmd({ dockerId, command: `docker container ls --filter "label=coolify.buildId=${buildId}" --format '{{json .}}'` })
|
||||||
@ -1890,14 +1895,16 @@ export async function stopBuild(buildId, applicationId) {
|
|||||||
if (!containerObj.Names.startsWith(`${applicationId} `)) {
|
if (!containerObj.Names.startsWith(`${applicationId} `)) {
|
||||||
await removeContainer({ id, dockerId });
|
await removeContainer({ id, dockerId });
|
||||||
clearInterval(interval);
|
clearInterval(interval);
|
||||||
|
if (scheduler.workers.has('deployApplication')) {
|
||||||
|
scheduler.workers.get('deployApplication').postMessage("action:flushQueue")
|
||||||
|
}
|
||||||
|
await cleanupDB(buildId);
|
||||||
return resolve();
|
return resolve();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
count++;
|
count++;
|
||||||
} catch (error) { } finally {
|
} catch (error) { }
|
||||||
await cleanupDB(buildId);
|
|
||||||
}
|
|
||||||
}, 100);
|
}, 100);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1905,7 +1912,7 @@ export async function stopBuild(buildId, applicationId) {
|
|||||||
async function cleanupDB(buildId: string) {
|
async function cleanupDB(buildId: string) {
|
||||||
const data = await prisma.build.findUnique({ where: { id: buildId } });
|
const data = await prisma.build.findUnique({ where: { id: buildId } });
|
||||||
if (data?.status === 'queued' || data?.status === 'running') {
|
if (data?.status === 'queued' || data?.status === 'running') {
|
||||||
await prisma.build.update({ where: { id: buildId }, data: { status: 'failed' } });
|
await prisma.build.update({ where: { id: buildId }, data: { status: 'canceled' } });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1914,10 +1921,7 @@ export function convertTolOldVolumeNames(type) {
|
|||||||
return 'nc'
|
return 'nc'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// export async function getAvailableServices(): Promise<any> {
|
|
||||||
// const { data } = await axios.get(`https://gist.githubusercontent.com/andrasbacsai/4aac36d8d6214dbfc34fa78110554a50/raw/5b27e6c37d78aaeedc1148d797112c827a2f43cf/availableServices.json`)
|
|
||||||
// return data
|
|
||||||
//
|
|
||||||
export async function cleanupDockerStorage(dockerId, lowDiskSpace, force) {
|
export async function cleanupDockerStorage(dockerId, lowDiskSpace, force) {
|
||||||
// Cleanup old coolify images
|
// Cleanup old coolify images
|
||||||
try {
|
try {
|
||||||
|
@ -2,7 +2,8 @@ import Bree from 'bree';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import Cabin from 'cabin';
|
import Cabin from 'cabin';
|
||||||
import TSBree from '@breejs/ts-worker';
|
import TSBree from '@breejs/ts-worker';
|
||||||
import { isDev } from './common';
|
|
||||||
|
export const isDev = process.env.NODE_ENV === 'development';
|
||||||
|
|
||||||
Bree.extend(TSBree);
|
Bree.extend(TSBree);
|
||||||
|
|
||||||
|
@ -146,6 +146,7 @@
|
|||||||
class="tooltip tooltip-primary tooltip-top flex cursor-pointer items-center justify-center border-l-2 py-4 no-underline transition-all duration-100 hover:bg-coolgray-400 hover:shadow-xl"
|
class="tooltip tooltip-primary tooltip-top flex cursor-pointer items-center justify-center border-l-2 py-4 no-underline transition-all duration-100 hover:bg-coolgray-400 hover:shadow-xl"
|
||||||
class:bg-coolgray-400={buildId === build.id}
|
class:bg-coolgray-400={buildId === build.id}
|
||||||
class:border-red-500={build.status === 'failed'}
|
class:border-red-500={build.status === 'failed'}
|
||||||
|
class:border-orange-500={build.status === 'canceled'}
|
||||||
class:border-green-500={build.status === 'success'}
|
class:border-green-500={build.status === 'success'}
|
||||||
class:border-yellow-500={build.status === 'running'}
|
class:border-yellow-500={build.status === 'running'}
|
||||||
>
|
>
|
||||||
|
@ -194,12 +194,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<button class="bg-coollabs hover:bg-coollabs-100" on:click={() => redeploy(container)}
|
<button class="btn btn-sm bg-coollabs hover:bg-coollabs-100" on:click={() => redeploy(container)}
|
||||||
>{$t('application.preview.redeploy')}</button
|
>{$t('application.preview.redeploy')}</button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
<button
|
<button
|
||||||
|
class="btn btn-sm"
|
||||||
class:bg-red-600={!loading.removing}
|
class:bg-red-600={!loading.removing}
|
||||||
class:hover:bg-red-500={!loading.removing}
|
class:hover:bg-red-500={!loading.removing}
|
||||||
disabled={loading.removing}
|
disabled={loading.removing}
|
||||||
|
@ -343,7 +343,7 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{:else}
|
{:else if $appSession.teamId !== '0'}
|
||||||
<div class="text-center text-xl font-bold">Nothing is configured yet.</div>
|
<div class="text-center text-xl font-bold">Nothing is configured yet.</div>
|
||||||
{/if}
|
{/if}
|
||||||
{#if $appSession.teamId === '0'}
|
{#if $appSession.teamId === '0'}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "coolify",
|
"name": "coolify",
|
||||||
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
"description": "An open-source & self-hostable Heroku / Netlify alternative.",
|
||||||
"version": "3.8.0",
|
"version": "3.8.1",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"repository": "github:coollabsio/coolify",
|
"repository": "github:coollabsio/coolify",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user