diff --git a/apps/api/prisma/seed.js b/apps/api/prisma/seed.js index 6dcba147d..3d4b16a28 100644 --- a/apps/api/prisma/seed.js +++ b/apps/api/prisma/seed.js @@ -90,11 +90,6 @@ async function main() { } } } - // Add default docker registry (dockerhub) - // const registries = await prisma.dockerRegistry.findMany() - // if (registries.length === 0) { - // await prisma.dockerRegistry.create({ data: { id: "0", name: 'Docker Hub', url: 'https://index.docker.io/v1/', isSystemWide: true, team: { connect: { id: '0' } } } }) - // } } main() .catch((e) => { diff --git a/apps/api/src/jobs/deployApplication.ts b/apps/api/src/jobs/deployApplication.ts index e21a343fc..7dc9cd24a 100644 --- a/apps/api/src/jobs/deployApplication.ts +++ b/apps/api/src/jobs/deployApplication.ts @@ -301,7 +301,7 @@ import * as buildpacks from '../lib/buildPacks'; } try { await executeDockerCmd({ debug, buildId, applicationId, dockerId: destinationDocker.id, command: `docker compose --project-directory ${workdir} up -d` }) - await saveBuildLog({ line: 'Deployment | Successful! 🎉', buildId, applicationId }); + await saveBuildLog({ line: 'Deployed successfully 🎉', buildId, applicationId }); await prisma.build.update({ where: { id: buildId }, data: { status: 'success' } }); await prisma.application.update({ where: { id: applicationId }, @@ -362,7 +362,7 @@ import * as buildpacks from '../lib/buildPacks'; // } try { - await saveBuildLog({ line: 'Deployment | Deployment initiated.', buildId, applicationId }); + await saveBuildLog({ line: 'Deployment initiated', buildId, applicationId }); const composeVolumes = volumes.map((volume) => { return { [`${volume.split(':')[0]}`]: { @@ -394,7 +394,7 @@ import * as buildpacks from '../lib/buildPacks'; }; await fs.writeFile(`${workdir}/docker-compose.yml`, yaml.dump(composeFile)); await executeDockerCmd({ dockerId: destinationDocker.id, command: `docker compose --project-directory ${workdir} up -d` }) - await saveBuildLog({ line: 'Deployment | Successful! 🎉', buildId, applicationId }); + await saveBuildLog({ line: 'Deployed successfully 🎉', buildId, applicationId }); } catch (error) { await saveBuildLog({ line: error, buildId, applicationId }); const foundBuild = await prisma.build.findUnique({ where: { id: buildId } }) diff --git a/apps/api/src/lib/buildPacks/common.ts b/apps/api/src/lib/buildPacks/common.ts index a9727814f..99e6ea140 100644 --- a/apps/api/src/lib/buildPacks/common.ts +++ b/apps/api/src/lib/buildPacks/common.ts @@ -641,9 +641,9 @@ export async function buildImage({ commit }) { if (isCache) { - await saveBuildLog({ line: `Cache | Building cache image.`, buildId, applicationId }); + await saveBuildLog({ line: `Building cache image`, buildId, applicationId }); } else { - await saveBuildLog({ line: `Production | Building production image.`, buildId, applicationId }); + await saveBuildLog({ line: `Building production image`, buildId, applicationId }); } if (!debug) { await saveBuildLog({ @@ -667,12 +667,12 @@ export async function buildImage({ const { status } = await prisma.build.findUnique({ where: { id: buildId } }) if (status === 'canceled') { - throw new Error('Deployment | Canceled.') + throw new Error('Canceled.') } if (isCache) { - await saveBuildLog({ line: `Cache | Successful! 🎉`, buildId, applicationId }); + await saveBuildLog({ line: `Building cache image built successful 🎉`, buildId, applicationId }); } else { - await saveBuildLog({ line: `Production | Successful! 🎉`, buildId, applicationId }); + await saveBuildLog({ line: `Building production image built successful 🎉`, buildId, applicationId }); } } diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts index 1c1bbb946..03bf7265e 100644 --- a/apps/api/src/lib/common.ts +++ b/apps/api/src/lib/common.ts @@ -1535,7 +1535,7 @@ export async function stopBuild(buildId, applicationId) { scheduler.workers.get('deployApplication').postMessage('cancel'); } await cleanupDB(buildId, applicationId); - return reject(new Error('Deployment | Canceled.')); + return reject(new Error('Canceled.')); } const { stdout: buildContainers } = await executeDockerCmd({ dockerId, @@ -1568,7 +1568,7 @@ async function cleanupDB(buildId: string, applicationId: string) { if (data?.status === 'queued' || data?.status === 'running') { await prisma.build.update({ where: { id: buildId }, data: { status: 'canceled' } }); } - await saveBuildLog({ line: 'Deployment | Canceled.', buildId, applicationId }); + await saveBuildLog({ line: 'Canceled.', buildId, applicationId }); } export function convertTolOldVolumeNames(type) { diff --git a/apps/api/src/lib/importers/github.ts b/apps/api/src/lib/importers/github.ts index a2196908b..62adf413b 100644 --- a/apps/api/src/lib/importers/github.ts +++ b/apps/api/src/lib/importers/github.ts @@ -30,16 +30,15 @@ export default async function ({ }): Promise { const { default: got } = await import('got') const url = htmlUrl.replace('https://', '').replace('http://', ''); - await saveBuildLog({ line: 'Importer | Warming up GitHub importer.', buildId, applicationId }); if (forPublic) { await saveBuildLog({ - line: `Importer | Cloning ${repository}:${branch} branch.`, + line: `Cloning ${repository}:${branch} branch`, buildId, applicationId }); if (gitCommitHash) { await saveBuildLog({ - line: `Importer | Checking out ${gitCommitHash} commit.`, + line: `Checking out ${gitCommitHash} commit`, buildId, applicationId }); @@ -71,13 +70,13 @@ export default async function ({ }) .json(); await saveBuildLog({ - line: `Importer | Cloning ${repository}:${branch} branch.`, + line: `Cloning ${repository}:${branch} branch`, buildId, applicationId }); if (gitCommitHash) { await saveBuildLog({ - line: `Importer | Checking out ${gitCommitHash} commit.`, + line: `Checking out ${gitCommitHash} commit`, buildId, applicationId }); diff --git a/apps/api/src/lib/importers/gitlab.ts b/apps/api/src/lib/importers/gitlab.ts index 2c247e64f..0e2ef7b32 100644 --- a/apps/api/src/lib/importers/gitlab.ts +++ b/apps/api/src/lib/importers/gitlab.ts @@ -27,21 +27,19 @@ export default async function ({ forPublic: boolean; }): Promise { const url = htmlUrl.replace('https://', '').replace('http://', '').replace(/\/$/, ''); - await saveBuildLog({ line: 'Importer | Warming up GitLab importer.', buildId, applicationId }); - if (!forPublic) { await asyncExecShell(`echo '${privateSshKey}' > ${repodir}/id.rsa`); await asyncExecShell(`chmod 600 ${repodir}/id.rsa`); } await saveBuildLog({ - line: `Importer | Cloning ${repository}:${branch} branch.`, + line: `Cloning ${repository}:${branch} branch`, buildId, applicationId }); if (gitCommitHash) { await saveBuildLog({ - line: `Importer | Checking out ${gitCommitHash} commit.`, + line: `Checking out ${gitCommitHash} commit`, buildId, applicationId });