Store domain for DNS deployments after previous deployment is deleted
This commit is contained in:
parent
9caf6220b4
commit
2347248fdd
@ -376,8 +376,7 @@ export class Registry {
|
|||||||
return records.filter((record: AppDeploymentRecord) =>
|
return records.filter((record: AppDeploymentRecord) =>
|
||||||
deployments.some(
|
deployments.some(
|
||||||
(deployment) =>
|
(deployment) =>
|
||||||
deployment.applicationDeploymentRequestId === record.attributes.request &&
|
deployment.applicationDeploymentRequestId === record.attributes.request
|
||||||
record.attributes.url.includes(deployment.id)
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -231,6 +231,9 @@ export class Service {
|
|||||||
|
|
||||||
if (oldDNSDeployment) {
|
if (oldDNSDeployment) {
|
||||||
await this.db.deleteDeploymentById(oldDNSDeployment.id);
|
await this.db.deleteDeploymentById(oldDNSDeployment.id);
|
||||||
|
if (oldDNSDeployment.domain) {
|
||||||
|
await this.db.updateDeploymentById(deployment.id, { domain: oldDNSDeployment.domain})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -697,7 +700,6 @@ export class Service {
|
|||||||
await this.db.updateDeploymentById(dnsDeployment.id, {
|
await this.db.updateDeploymentById(dnsDeployment.id, {
|
||||||
applicationDeploymentRequestId,
|
applicationDeploymentRequestId,
|
||||||
applicationDeploymentRequestData,
|
applicationDeploymentRequestData,
|
||||||
domainId: domain?.id ?? null
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -716,7 +718,6 @@ export class Service {
|
|||||||
await this.db.updateDeploymentById(deployment.id, {
|
await this.db.updateDeploymentById(deployment.id, {
|
||||||
applicationDeploymentRequestId,
|
applicationDeploymentRequestId,
|
||||||
applicationDeploymentRequestData,
|
applicationDeploymentRequestData,
|
||||||
domainId: domain?.id ?? null
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return deployment;
|
return deployment;
|
||||||
@ -1216,7 +1217,11 @@ export class Service {
|
|||||||
projectId: deployment.project.id,
|
projectId: deployment.project.id,
|
||||||
deployer: deployment.deployer,
|
deployer: deployment.deployer,
|
||||||
isDNS: true
|
isDNS: true
|
||||||
}
|
},
|
||||||
|
relations: {
|
||||||
|
project: true,
|
||||||
|
deployer: true,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
if (!dnsDeployment) {
|
if (!dnsDeployment) {
|
||||||
@ -1226,7 +1231,7 @@ export class Service {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await this.laconicRegistry.createApplicationDeploymentRemovalRequest({
|
await this.laconicRegistry.createApplicationDeploymentRemovalRequest({
|
||||||
deploymentId: dnsDeployment.id,
|
deploymentId: dnsDeployment.applicationDeploymentRecordId!,
|
||||||
deployerLrn: dnsDeployment.deployer.deployerLrn,
|
deployerLrn: dnsDeployment.deployer.deployerLrn,
|
||||||
auctionId: dnsDeployment.project.auctionId,
|
auctionId: dnsDeployment.project.auctionId,
|
||||||
payment: dnsDeployment.project.txHash
|
payment: dnsDeployment.project.txHash
|
||||||
|
Loading…
Reference in New Issue
Block a user