diff --git a/apps/api/src/jobs/deployApplication.ts b/apps/api/src/jobs/deployApplication.ts index 89859620f..ba0281b02 100644 --- a/apps/api/src/jobs/deployApplication.ts +++ b/apps/api/src/jobs/deployApplication.ts @@ -211,7 +211,6 @@ import * as buildpacks from '../lib/buildPacks'; // } await copyBaseConfigurationFiles(buildPack, workdir, buildId, applicationId, baseImage); - if (forceRebuild) deployNeeded = true if (!imageFound || deployNeeded) { // if (true) { diff --git a/apps/api/src/lib/buildPacks/common.ts b/apps/api/src/lib/buildPacks/common.ts index 37a4b023c..c5d589bda 100644 --- a/apps/api/src/lib/buildPacks/common.ts +++ b/apps/api/src/lib/buildPacks/common.ts @@ -472,7 +472,8 @@ export const saveBuildLog = async ({ if (isDev) { console.debug(`[${applicationId}] ${addTimestamp}`); - } + return + } try { return await got.post(`${fluentBitUrl}/${applicationId}_buildlog_${buildId}.csv`, { json: { @@ -586,9 +587,9 @@ export async function buildImage({ } else { await saveBuildLog({ line: `Building image started.`, buildId, applicationId }); } - if (!debug && isCache) { + if (!debug) { await saveBuildLog({ - line: `Debug turned off. To see more details, allow it in the configuration.`, + line: `Debug turned off. To see more details, allow it in the features tab.`, buildId, applicationId }); @@ -607,30 +608,6 @@ export async function buildImage({ } } -export async function streamEvents({ stream, docker, buildId, applicationId, debug }) { - await new Promise((resolve, reject) => { - docker.engine.modem.followProgress(stream, onFinished, onProgress); - function onFinished(err, res) { - if (err) reject(err); - resolve(res); - } - async function onProgress(event) { - if (event.error) { - reject(event.error); - } else if (event.stream) { - if (event.stream !== '\n') { - if (debug) - await saveBuildLog({ - line: `${event.stream.replace('\n', '')}`, - buildId, - applicationId - }); - } - } - } - }); -} - export function makeLabelForStandaloneApplication({ applicationId, fqdn, @@ -721,6 +698,7 @@ export async function buildCacheImageWithNode(data, imageForBuild) { if (installCommand) { Dockerfile.push(`RUN ${installCommand}`); } + // Dockerfile.push(`ARG CACHEBUST=1`); Dockerfile.push(`RUN ${buildCommand}`); await fs.writeFile(`${workdir}/Dockerfile-cache`, Dockerfile.join('\n')); await buildImage({ ...data, isCache: true }); diff --git a/apps/api/src/lib/buildPacks/docker.ts b/apps/api/src/lib/buildPacks/docker.ts index e8cfd89bc..777dda157 100644 --- a/apps/api/src/lib/buildPacks/docker.ts +++ b/apps/api/src/lib/buildPacks/docker.ts @@ -13,36 +13,33 @@ export default async function (data) { pullmergeRequestId, dockerFileLocation } = data - try { - const file = `${workdir}${baseDirectory}${dockerFileLocation}`; - data.workdir = `${workdir}${baseDirectory}`; - const Dockerfile: Array = (await fs.readFile(`${file}`, 'utf8')) - .toString() - .trim() - .split('\n'); - Dockerfile.push(`LABEL coolify.buildId=${buildId}`); - if (secrets.length > 0) { - secrets.forEach((secret) => { - if (secret.isBuildSecret) { - if ( - (pullmergeRequestId && secret.isPRMRSecret) || - (!pullmergeRequestId && !secret.isPRMRSecret) - ) { - Dockerfile.unshift(`ARG ${secret.name}=${secret.value}`); + const file = `${workdir}${baseDirectory}${dockerFileLocation}`; + data.workdir = `${workdir}${baseDirectory}`; + const DockerfileRaw = await fs.readFile(`${file}`, 'utf8') + const Dockerfile: Array = DockerfileRaw + .toString() + .trim() + .split('\n'); + Dockerfile.push(`LABEL coolify.buildId=${buildId}`); + if (secrets.length > 0) { + secrets.forEach((secret) => { + if (secret.isBuildSecret) { + if ( + (pullmergeRequestId && secret.isPRMRSecret) || + (!pullmergeRequestId && !secret.isPRMRSecret) + ) { + Dockerfile.unshift(`ARG ${secret.name}=${secret.value}`); - Dockerfile.forEach((line, index) => { - if (line.startsWith('FROM')) { - Dockerfile.splice(index + 1, 0, `ARG ${secret.name}`); - } - }); - } + Dockerfile.forEach((line, index) => { + if (line.startsWith('FROM')) { + Dockerfile.splice(index + 1, 0, `ARG ${secret.name}`); + } + }); } - }); - } - - await fs.writeFile(`${workdir}${dockerFileLocation}`, Dockerfile.join('\n')); - await buildImage(data); - } catch (error) { - throw error; + } + }); } + + await fs.writeFile(`${workdir}${dockerFileLocation}`, Dockerfile.join('\n')); + await buildImage(data); } diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts index b87fe4eef..5435e976e 100644 --- a/apps/api/src/lib/common.ts +++ b/apps/api/src/lib/common.ts @@ -21,7 +21,7 @@ import { scheduler } from './scheduler'; import { supportedServiceTypesAndVersions } from './services/supportedVersions'; import { includeServices } from './services/common'; -export const version = '3.10.8'; +export const version = '3.10.9'; export const isDev = process.env.NODE_ENV === 'development'; const algorithm = 'aes-256-ctr'; @@ -1651,10 +1651,10 @@ export async function cleanupDockerStorage(dockerId, lowDiskSpace, force) { } } catch (error) { } if (lowDiskSpace || force) { - if (isDev) { - if (!force) console.log(`[DEV MODE] Low disk space: ${lowDiskSpace}`); - return; - } + // if (isDev) { + // if (!force) console.log(`[DEV MODE] Low disk space: ${lowDiskSpace}`); + // return; + // } try { await executeDockerCmd({ dockerId, diff --git a/apps/ui/src/routes/_NewResource.svelte b/apps/ui/src/routes/_NewResource.svelte index 3e73752bf..e3c494aa3 100644 --- a/apps/ui/src/routes/_NewResource.svelte +++ b/apps/ui/src/routes/_NewResource.svelte @@ -18,8 +18,8 @@ + + {/if}
Force Redeploy (without cache) - {:else} - {#if $isDeploymentEnabled} + {:else if $isDeploymentEnabled} - {/if} {/if} {#if $location && $status.application.isRunning} diff --git a/apps/ui/src/routes/applications/[id]/index.svelte b/apps/ui/src/routes/applications/[id]/index.svelte index bc2a4e26a..39740157f 100644 --- a/apps/ui/src/routes/applications/[id]/index.svelte +++ b/apps/ui/src/routes/applications/[id]/index.svelte @@ -266,7 +266,6 @@ await getBaseBuildImages(); await handleSubmit(); } - async function isDNSValid(domain: any, isWWW: any) { try { await get(`/applications/${id}/check?domain=${domain}`); @@ -707,24 +706,6 @@ />
{/if} - {#if application.buildPack === 'docker'} -
- - -
- {/if} {#if application.buildPack === 'deno'}
@@ -776,6 +757,31 @@ />
{/if} + {#if application.buildPack === 'docker'} +
+ +
+ + +
+ +
+ {/if} {#if !notNodeDeployments.includes(application.buildPack)}
diff --git a/apps/ui/src/routes/applications/[id]/logs/_BuildLog.svelte b/apps/ui/src/routes/applications/[id]/logs/_BuildLog.svelte index eeccd7988..84027ae6f 100644 --- a/apps/ui/src/routes/applications/[id]/logs/_BuildLog.svelte +++ b/apps/ui/src/routes/applications/[id]/logs/_BuildLog.svelte @@ -7,6 +7,7 @@ import Tooltip from '$lib/components/Tooltip.svelte'; import { day } from '$lib/dayjs'; import { selectedBuildId } from '$lib/store'; + import { dev } from '$app/env'; let logs: any = []; let currentStatus: any; @@ -104,86 +105,86 @@ }); -
- + {followingLogs ? 'Following Logs...' : 'Follow Logs'} + - - {#if currentStatus === 'running'} + + + + + {cancelInprogress ? 'Cancelling...' : 'Cancel Build'} + + {#if currentStatus === 'running'}
- {#if currentStatus === 'queued'} -
- {$t('application.build.queued_waiting_exec')} -
- {:else if logs.length > 0} -
- {#each logs as log} - {#if fromDb} -
{log.line + '\n'}
- {:else} -
[{day.unix(log.time).format('HH:mm:ss.SSS')}] {log.line + '\n'}
- {/if} - {/each} -
- {:else} -
- No logs found yet. -
{/if} +
+{#if currentStatus === 'queued'} +
+ {$t('application.build.queued_waiting_exec')} +
+{:else if logs.length > 0} +
+ {#each logs as log} + {#if fromDb} +
{log.line + '\n'}
+ {:else} +
[{day.unix(log.time).format('HH:mm:ss.SSS')}] {log.line + '\n'}
+ {/if} + {/each} +
+{:else} +
+ {dev ? 'In development, logs are shown in the console.' : 'No logs found yet.'} +
+{/if} diff --git a/apps/ui/src/routes/index.svelte b/apps/ui/src/routes/index.svelte index 15ba421ad..4b41d56e5 100644 --- a/apps/ui/src/routes/index.svelte +++ b/apps/ui/src/routes/index.svelte @@ -309,6 +309,128 @@ {/if}
+
+ + + + + +
{#if applications.length !== 0 || destinations.length !== 0 || databases.length !== 0 || services.length !== 0 || gitSources.length !== 0 || destinations.length !== 0}
@@ -343,40 +465,16 @@