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