Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
feat(release): add an option to skip artifact record update in release
Browse files Browse the repository at this point in the history
Add a new property called `skipArtifactUpdate` which allows for skipping insertion of artifact
versions to sfpowerscripts_artifact2__c. This is useful in case of diff packages where  hotfix
deployments should not alter the  version already recorded. A  better variant  of this will be
released at later stage
  • Loading branch information
azlam-abdulsalam authored and azlam-abdulsalam committed Aug 11, 2023
1 parent fdeb4a2 commit eaa8a0c
Show file tree
Hide file tree
Showing 7 changed files with 818 additions and 1,847 deletions.
2,649 changes: 803 additions & 1,846 deletions package-lock.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"skipIfAlreadyInstalled": {
"type": "boolean"
},
"skipArtifactUpdate": {
"type": "boolean"
},
"baselineOrg": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
"skipIfAlreadyInstalled": {
"type": "boolean"
},
"skipArtifactUpdate": {
"type": "boolean"
},
"baselineOrg": {
"type": "string"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { LoggerLevel } from '@dxatscale/sfp-logger';
import Git from '@dxatscale/sfpowerscripts.core/lib/git/Git';
import GitTags from '@dxatscale/sfpowerscripts.core/lib/git/GitTags';
const retry = require('async-retry');
import yaml from 'js-yaml'
const yaml = require('js-yaml');
const path = require('path');

export default class ReleaseDefinitionGenerator {
Expand Down Expand Up @@ -182,6 +182,7 @@ export default class ReleaseDefinitionGenerator {
let releaseDefinition: ReleaseDefinitionSchema = {
release: this.releaseName,
skipIfAlreadyInstalled: true,
skipArtifactUpdate:false,
artifacts: artifacts,
};

Expand All @@ -195,6 +196,10 @@ export default class ReleaseDefinitionGenerator {
if(this.releaseDefinitionGeneratorConfigSchema.releasedefinitionProperties?.skipIfAlreadyInstalled)
releaseDefinition.skipIfAlreadyInstalled = this.releaseDefinitionGeneratorConfigSchema.releasedefinitionProperties?.skipIfAlreadyInstalled;

//override skip artifact update
if(this.releaseDefinitionGeneratorConfigSchema.releasedefinitionProperties?.skipArtifactUpdate)
releaseDefinition.skipArtifactUpdate = this.releaseDefinitionGeneratorConfigSchema.releasedefinitionProperties?.skipArtifactUpdate;

//Add changelog info
releaseDefinition.changelog = this.releaseDefinitionGeneratorConfigSchema.releasedefinitionProperties?.changelog;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default interface ReleaseDefinitionGeneratorSchema {
includeOnlyPackageDependencies?: string[];
releasedefinitionProperties?: {
skipIfAlreadyInstalled: boolean;
skipArtifactUpdate:boolean;
baselineOrg?: string;
promotePackagesBeforeDeploymentToOrg?: string;
changelog?: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export default interface ReleaseDefinitionSchema {
release: string;
skipIfAlreadyInstalled: boolean;
skipArtifactUpdate:boolean;
baselineOrg?: string;
artifacts: {
[p: string]: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export default class ReleaseImpl {
currentStage: Stage.DEPLOY,
baselineOrg: releaseDefinition.baselineOrg,
isDryRun: this.props.isDryRun,
disableArtifactCommit: releaseDefinition.skipArtifactUpdate?releaseDefinition.skipArtifactUpdate:false,
promotePackagesBeforeDeploymentToOrg: releaseDefinition.promotePackagesBeforeDeploymentToOrg,
devhubUserName: this.props.devhubUserName,
};
Expand Down

0 comments on commit eaa8a0c

Please sign in to comment.