fixes
This commit is contained in:
parent
9d3ed85ffd
commit
12c0760cb3
@ -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) => {
|
||||
|
@ -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 } })
|
||||
|
@ -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 });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -30,16 +30,15 @@ export default async function ({
|
||||
}): Promise<string> {
|
||||
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
|
||||
});
|
||||
|
@ -27,21 +27,19 @@ export default async function ({
|
||||
forPublic: boolean;
|
||||
}): Promise<string> {
|
||||
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
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user