fix: df and more debug
This commit is contained in:
@@ -15,7 +15,7 @@ import { getEngine } from '../lib/docker';
|
|||||||
try {
|
try {
|
||||||
let stdout = null
|
let stdout = null
|
||||||
if (!isDev) {
|
if (!isDev) {
|
||||||
const output = await executeDockerCmd({ dockerId: destination.id, command: `docker exec coolify sh -c 'df -kPT /'` })
|
const output = await executeDockerCmd({ dockerId: destination.id, command: `CONTAINER=$(docker ps -lq | head -1) && docker exec $CONTAINER sh -c 'df -kPT /'` })
|
||||||
stdout = output.stdout;
|
stdout = output.stdout;
|
||||||
} else {
|
} else {
|
||||||
const output = await asyncExecShell(
|
const output = await asyncExecShell(
|
||||||
|
@@ -177,6 +177,7 @@ export async function getApplicationFromDB(id: string, teamId: string) {
|
|||||||
}
|
}
|
||||||
export async function getApplicationFromDBWebhook(projectId: number, branch: string) {
|
export async function getApplicationFromDBWebhook(projectId: number, branch: string) {
|
||||||
try {
|
try {
|
||||||
|
console.log({ projectId, branch })
|
||||||
let application = await prisma.application.findFirst({
|
let application = await prisma.application.findFirst({
|
||||||
where: { projectId, branch, settings: { autodeploy: true } },
|
where: { projectId, branch, settings: { autodeploy: true } },
|
||||||
include: {
|
include: {
|
||||||
@@ -187,6 +188,7 @@ export async function getApplicationFromDBWebhook(projectId: number, branch: str
|
|||||||
persistentStorage: true
|
persistentStorage: true
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
console.log({ application })
|
||||||
if (!application) {
|
if (!application) {
|
||||||
throw { status: 500, message: 'Application not configured.' }
|
throw { status: 500, message: 'Application not configured.' }
|
||||||
}
|
}
|
||||||
|
@@ -86,6 +86,7 @@ export async function gitHubEvents(request: FastifyRequest<GitHubEvents>): Promi
|
|||||||
projectId = repository.id;
|
projectId = repository.id;
|
||||||
branch = body.pull_request.head.ref.includes('/') ? body.pull_request.head.ref.split('/')[2] : body.pull_request.head.ref;
|
branch = body.pull_request.head.ref.includes('/') ? body.pull_request.head.ref.split('/')[2] : body.pull_request.head.ref;
|
||||||
}
|
}
|
||||||
|
console.log({repository, projectId, branch})
|
||||||
if (!projectId || !branch) {
|
if (!projectId || !branch) {
|
||||||
throw { status: 500, message: 'Cannot parse projectId or branch from the webhook?!' }
|
throw { status: 500, message: 'Cannot parse projectId or branch from the webhook?!' }
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user