Update deployment request config value if not env variables are set

This commit is contained in:
IshaVenikar 2025-02-03 16:40:03 +05:30
parent 22bb409617
commit ced815802e
2 changed files with 11 additions and 10 deletions

View File

@ -265,12 +265,15 @@ export class Registry {
throw new Error(`No record found for ${lrn}`); throw new Error(`No record found for ${lrn}`);
} }
const hash = await this.generateConfigHash( let hash;
data.environmentVariables, if (Object.keys(data.environmentVariables).length !== 0) {
data.requesterAddress, hash = await this.generateConfigHash(
data.publicKey, data.environmentVariables,
data.apiUrl, data.requesterAddress,
); data.publicKey,
data.apiUrl,
);
}
// Create record of type ApplicationDeploymentRequest and publish // Create record of type ApplicationDeploymentRequest and publish
const applicationDeploymentRequest = { const applicationDeploymentRequest = {
@ -281,9 +284,7 @@ export class Registry {
dns: data.dns, dns: data.dns,
// https://git.vdb.to/cerc-io/laconic-registry-cli/commit/129019105dfb93bebcea02fde0ed64d0f8e5983b // https://git.vdb.to/cerc-io/laconic-registry-cli/commit/129019105dfb93bebcea02fde0ed64d0f8e5983b
config: JSON.stringify({ config: JSON.stringify(hash ? { ref: hash } : {}),
ref: hash,
}),
meta: JSON.stringify({ meta: JSON.stringify({
note: `Added by Snowball @ ${DateTime.utc().toFormat( note: `Added by Snowball @ ${DateTime.utc().toFormat(
"EEE LLL dd HH:mm:ss 'UTC' yyyy" "EEE LLL dd HH:mm:ss 'UTC' yyyy"

View File

@ -243,7 +243,7 @@ export class Service {
if (oldDNSDeployment) { if (oldDNSDeployment) {
// Send removal request for the previous DNS deployment and delete DB entry // Send removal request for the previous DNS deployment and delete DB entry
if (oldDNSDeployment.url === deployment.url) { if (oldDNSDeployment.url !== deployment.url) {
await this.laconicRegistry.createApplicationDeploymentRemovalRequest({ await this.laconicRegistry.createApplicationDeploymentRemovalRequest({
deploymentId: oldDNSDeployment.applicationDeploymentRecordId!, deploymentId: oldDNSDeployment.applicationDeploymentRecordId!,
deployerLrn: oldDNSDeployment.deployer.deployerLrn, deployerLrn: oldDNSDeployment.deployer.deployerLrn,