fix: PR deployments view
This commit is contained in:
parent
ebdd3601b3
commit
b01f5f47b3
@ -17,7 +17,7 @@ export const get: RequestHandler = async (event) => {
|
|||||||
const destinationDocker = await db.getDestinationByApplicationId({ id, teamId });
|
const destinationDocker = await db.getDestinationByApplicationId({ id, teamId });
|
||||||
const docker = dockerInstance({ destinationDocker });
|
const docker = dockerInstance({ destinationDocker });
|
||||||
const listContainers = await docker.engine.listContainers({
|
const listContainers = await docker.engine.listContainers({
|
||||||
filters: { network: [destinationDocker.network] }
|
filters: { network: [destinationDocker.network], name: [id] }
|
||||||
});
|
});
|
||||||
const containers = listContainers.filter((container) => {
|
const containers = listContainers.filter((container) => {
|
||||||
return (
|
return (
|
||||||
@ -30,11 +30,7 @@ export const get: RequestHandler = async (event) => {
|
|||||||
JSON.parse(Buffer.from(container.Labels['coolify.configuration'], 'base64').toString())
|
JSON.parse(Buffer.from(container.Labels['coolify.configuration'], 'base64').toString())
|
||||||
)
|
)
|
||||||
.filter((container) => {
|
.filter((container) => {
|
||||||
return (
|
return container.pullmergeRequestId && container.applicationId === id;
|
||||||
container.type !== 'manual' &&
|
|
||||||
container.type !== 'webhook_commit' &&
|
|
||||||
container.applicationId === id
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
return {
|
return {
|
||||||
body: {
|
body: {
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
import { errorNotification } from '$lib/form';
|
import { errorNotification } from '$lib/form';
|
||||||
import { toast } from '@zerodevx/svelte-toast';
|
import { toast } from '@zerodevx/svelte-toast';
|
||||||
import { t } from '$lib/translations';
|
import { t } from '$lib/translations';
|
||||||
|
import { goto } from '$app/navigation';
|
||||||
|
|
||||||
const { id } = $page.params;
|
const { id } = $page.params;
|
||||||
async function refreshSecrets() {
|
async function refreshSecrets() {
|
||||||
@ -39,11 +40,18 @@
|
|||||||
}
|
}
|
||||||
async function redeploy(container) {
|
async function redeploy(container) {
|
||||||
try {
|
try {
|
||||||
await post(`/applications/${id}/deploy.json`, {
|
const { buildId } = await post(`/applications/${id}/deploy.json`, {
|
||||||
pullmergeRequestId: container.pullmergeRequestId,
|
pullmergeRequestId: container.pullmergeRequestId,
|
||||||
branch: container.branch
|
branch: container.branch
|
||||||
});
|
});
|
||||||
toast.push('Application redeployed queued.');
|
toast.push('Application redeployed queued.');
|
||||||
|
if ($page.url.pathname.startsWith(`/applications/${id}/logs/build`)) {
|
||||||
|
return window.location.assign(`/applications/${id}/logs/build?buildId=${buildId}`);
|
||||||
|
} else {
|
||||||
|
return await goto(`/applications/${id}/logs/build?buildId=${buildId}`, {
|
||||||
|
replaceState: true
|
||||||
|
});
|
||||||
|
}
|
||||||
} catch ({ error }) {
|
} catch ({ error }) {
|
||||||
return errorNotification(error);
|
return errorNotification(error);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user