File tree Expand file tree Collapse file tree 5 files changed +18
-10
lines changed
src/PostSharp.Engineering.BuildTools Expand file tree Collapse file tree 5 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -221,8 +221,10 @@ void AddComponents( IEnumerable<IBuildComponent>? newComponents )
221221 public bool AddWslSupport { get ; init ; }
222222
223223 public DockerSpec ? DockerSpec
224- => this . ResolvedBuildAgentRequirements . IsDockerized
225- ? new DockerSpec ( $ "{ this . ProductNameWithoutDot } -{ this . ProductFamily . Version } ". ToLowerInvariant ( ) )
224+ => this . ResolvedBuildAgentRequirements is ContainerHostRequirements containerHostRequirements
225+ ? new DockerSpec (
226+ $ "{ this . ProductNameWithoutDot } -{ this . ProductFamily . Version } ". ToLowerInvariant ( ) ,
227+ containerHostRequirements . Memory )
226228 : null ;
227229
228230 public bool IsPublishingNonReleaseBranchesAllowed { get ; init ; }
Original file line number Diff line number Diff line change @@ -107,8 +107,9 @@ internal override TeamCityBuildConfiguration TeamCityBuildConfiguration(
107107 this . Script ,
108108 this . Arguments ,
109109 this . BuildAgentRequirements == null ? product . DockerSpec :
110- this . BuildAgentRequirements . IsDockerized ? new DockerSpec (
111- $ "{ productProperties . Product . ProductNameWithoutDot } -{ productProperties . Product . ProductFamily . Version } -{ this . Id } ". ToLowerInvariant ( ) ) :
110+ this . BuildAgentRequirements is ContainerHostRequirements containerHostRequirements ? new DockerSpec (
111+ $ "{ productProperties . Product . ProductNameWithoutDot } -{ productProperties . Product . ProductFamily . Version } -{ this . Id } ". ToLowerInvariant ( ) ,
112+ containerHostRequirements . Memory ) :
112113 null ,
113114 true )
114115 {
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ public PowerShellScriptBuildStep(
4141 else
4242 {
4343 this . ScriptPath = "DockerBuild.ps1" ;
44- this . ScriptArguments = $ "-Script { scriptPath } -ImageName { dockerSpec . ImageName } -NoBuildImage { scriptArguments } { buildParameterValue } ";
44+ this . ScriptArguments = $ "-Script { scriptPath } -ImageName { dockerSpec . ImageName } -Memory { dockerSpec . Memory } G - NoBuildImage { scriptArguments } { buildParameterValue } ";
4545 }
4646
4747 if ( areCustomArgumentsAllowed )
Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ public record ContainerHostRequirements : BuildAgentRequirements
1313{
1414 public ContainerHostKind HostKind { get ; }
1515
16+ /// <summary>
17+ /// Gets or sets the memory limit in GB for Docker containers. Default is 8 GB.
18+ /// </summary>
19+ public int Memory { get ; init ; } = 8 ;
20+
1621 public ContainerHostRequirements ( ContainerHostKind hostKind ) : base (
1722 new BuildAgentRequirement ( "env.BuildAgentType" , ContainerHelper . GetBuildAgentType ( hostKind ) ) )
1823 {
Original file line number Diff line number Diff line change 1- // Copyright (c) SharpCrafters s.r.o. See the LICENSE.md file in the root directory of this repository root for details.
2-
3- namespace PostSharp . Engineering . BuildTools . Docker ;
4-
5- public record DockerSpec ( string ImageName ) ;
1+ // Copyright (c) SharpCrafters s.r.o. See the LICENSE.md file in the root directory of this repository root for details.
2+
3+ namespace PostSharp . Engineering . BuildTools . Docker ;
4+
5+ public record DockerSpec ( string ImageName , int Memory = 8 ) ;
You can’t perform that action at this time.
0 commit comments