Fetch deployment build logs

This commit is contained in:
Neeraj 2024-10-17 19:31:01 +05:30 committed by IshaVenikar
parent ae20f171a1
commit 94a6c66c36
5 changed files with 25 additions and 6 deletions

View File

@ -216,7 +216,8 @@ export class Database {
relations: {
project: true,
domain: true,
createdBy: true
createdBy: true,
deployer: true,
},
where: {
project: {

View File

@ -104,7 +104,8 @@ type Deployment {
commitMessage: String!
url: String
environment: Environment!
deployerId: String
deployer: Deployer
applicationDeploymentRequestId: String
isCurrent: Boolean!
baseDomain: String
status: DeploymentStatus!

View File

@ -72,6 +72,11 @@ const DeploymentDetailsCard = ({
leftIcon={getIconByDeploymentStatus(deployment.status)}
size="xs"
type={STATUS_COLORS[deployment.status] ?? 'neutral'}
onClick={async()=> {
let url = `${deployment.deployer.deployerApiUrl}/log/${deployment.applicationDeploymentRequestId}`
const res = await fetch(url);
console.log(">>>>RESPONSE",await res.text())
}}
>
{deployment.status}
</Tag>
@ -96,9 +101,9 @@ const DeploymentDetailsCard = ({
</OverflownText>
</Heading>
)}
{deployment.deployerLrn && (
{deployment.deployer.deployerLrn && (
<span className="text-sm text-elements-low-em tracking-tight block mt-2">
Deployer LRN: {deployment.deployerLrn}
Deployer LRN: {deployment.deployer.deployerLrn}
</span>
)}
<span className="text-sm text-elements-low-em tracking-tight block">

View File

@ -136,7 +136,11 @@ query ($projectId: String!) {
commitHash
commitMessage
url
deployerLrn
deployer {
deployerId
deployerLrn,
deployerApiUrl,
}
environment
isCurrent
baseDomain
@ -148,6 +152,7 @@ query ($projectId: String!) {
name
email
}
applicationDeploymentRequestId
}
}
`;

View File

@ -105,7 +105,7 @@ export type Deployment = {
commitHash: string;
commitMessage: string;
url?: string;
deployerLrn: string;
deployer: Deployer;
environment: Environment;
isCurrent: boolean;
baseDomain?: string;
@ -113,8 +113,15 @@ export type Deployment = {
createdBy: User;
createdAt: string;
updatedAt: string;
applicationDeploymentRequestId: string;
};
export type Deployer = {
deployerApiUrl: string;
deployerId: string;
deployerLrn: string;
}
export type OrganizationMember = {
id: string;
member: User;