Skip to content

Commit dd221fc

Browse files
committed
deploying production items will create production class if it does not already exist
1 parent 1c3bb4d commit dd221fc

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

cls/SourceControl/Git/Utils.cls

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,10 +1270,15 @@ ClassMethod ImportItem(InternalName As %String, force As %Boolean = 0, verbose A
12701270
// ideally we could just new %SourceControl, but Ens portal config pages do not use %SourceControl
12711271
new %gscSkipSaveHooks
12721272
set %gscSkipSaveHooks = 1
1273-
set targetProduction = $piece(InternalName,"||",1)
1274-
set rollbackFile = ##class(%File).TempFilename()
1275-
set sc = ##class(Ens.Deployment.Deploy).DeployCode(filename,targetProduction,0,rollbackFile)
1276-
do ##class(%File).Delete(rollbackFile)
1273+
do ##class(SourceControl.Git.Production).ParseInternalName(InternalName,,,,.targetProduction)
1274+
if (targetProduction '= "") && '$$$comClassDefined(targetProduction) {
1275+
set sc = ##class(SourceControl.Git.Production).CreateProduction(targetProduction)
1276+
}
1277+
if $$$ISOK(sc) {
1278+
set rollbackFile = ##class(%File).TempFilename()
1279+
set sc = ##class(Ens.Deployment.Deploy).DeployCode(filename,targetProduction,0,rollbackFile)
1280+
do ##class(%File).Delete(rollbackFile)
1281+
}
12771282
}
12781283
} elseif (type = "cls") && settings.decomposeProductions
12791284
&& ##class(SourceControl.Git.Production).IsProductionClass(

0 commit comments

Comments
 (0)