fixes
This commit is contained in:
parent
c0882dffde
commit
0dad616c38
@ -20,7 +20,11 @@ export default async function (data) {
|
||||
.toString()
|
||||
.trim()
|
||||
.split('\n');
|
||||
Dockerfile.push(`LABEL coolify.buildId=${buildId}`);
|
||||
Dockerfile.forEach((line, index) => {
|
||||
if (line.startsWith('FROM')) {
|
||||
Dockerfile.splice(index + 1, 0, `LABEL coolify.buildId=${buildId}`);
|
||||
}
|
||||
});
|
||||
if (secrets.length > 0) {
|
||||
secrets.forEach((secret) => {
|
||||
if (secret.isBuildSecret) {
|
||||
@ -28,11 +32,9 @@ export default async function (data) {
|
||||
(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.splice(index + 1, 0, `ARG ${secret.name}=${secret.value}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -843,18 +843,11 @@ export async function saveApplicationSource(request: FastifyRequest<SaveApplicat
|
||||
const { id } = request.params
|
||||
const { gitSourceId, forPublic, type, simpleDockerfile } = request.body
|
||||
if (forPublic) {
|
||||
if (gitSourceId) {
|
||||
await prisma.application.update({
|
||||
where: { id },
|
||||
data: { gitSource: { connect: { id: gitSourceId } } }
|
||||
});
|
||||
} else {
|
||||
const publicGit = await prisma.gitSource.findFirst({ where: { type, forPublic } });
|
||||
await prisma.application.update({
|
||||
where: { id },
|
||||
data: { gitSource: { connect: { id: publicGit.id } } }
|
||||
});
|
||||
}
|
||||
const publicGit = await prisma.gitSource.findFirst({ where: { type, forPublic } });
|
||||
await prisma.application.update({
|
||||
where: { id },
|
||||
data: { gitSource: { connect: { id: publicGit.id } } }
|
||||
});
|
||||
}
|
||||
if (simpleDockerfile) {
|
||||
await prisma.application.update({
|
||||
@ -862,6 +855,12 @@ export async function saveApplicationSource(request: FastifyRequest<SaveApplicat
|
||||
data: { simpleDockerfile, settings: { update: { autodeploy: false } } }
|
||||
});
|
||||
}
|
||||
if (gitSourceId) {
|
||||
await prisma.application.update({
|
||||
where: { id },
|
||||
data: { gitSource: { connect: { id: gitSourceId } } }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return reply.code(201).send()
|
||||
|
Loading…
x
Reference in New Issue
Block a user