Update deployment request config value if not env variables are set
This commit is contained in:
parent
22bb409617
commit
ced815802e
@ -265,12 +265,15 @@ export class Registry {
|
||||
throw new Error(`No record found for ${lrn}`);
|
||||
}
|
||||
|
||||
const hash = await this.generateConfigHash(
|
||||
let hash;
|
||||
if (Object.keys(data.environmentVariables).length !== 0) {
|
||||
hash = await this.generateConfigHash(
|
||||
data.environmentVariables,
|
||||
data.requesterAddress,
|
||||
data.publicKey,
|
||||
data.apiUrl,
|
||||
);
|
||||
}
|
||||
|
||||
// Create record of type ApplicationDeploymentRequest and publish
|
||||
const applicationDeploymentRequest = {
|
||||
@ -281,9 +284,7 @@ export class Registry {
|
||||
dns: data.dns,
|
||||
|
||||
// https://git.vdb.to/cerc-io/laconic-registry-cli/commit/129019105dfb93bebcea02fde0ed64d0f8e5983b
|
||||
config: JSON.stringify({
|
||||
ref: hash,
|
||||
}),
|
||||
config: JSON.stringify(hash ? { ref: hash } : {}),
|
||||
meta: JSON.stringify({
|
||||
note: `Added by Snowball @ ${DateTime.utc().toFormat(
|
||||
"EEE LLL dd HH:mm:ss 'UTC' yyyy"
|
||||
|
@ -243,7 +243,7 @@ export class Service {
|
||||
|
||||
if (oldDNSDeployment) {
|
||||
// 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({
|
||||
deploymentId: oldDNSDeployment.applicationDeploymentRecordId!,
|
||||
deployerLrn: oldDNSDeployment.deployer.deployerLrn,
|
||||
|
Loading…
Reference in New Issue
Block a user