Skip to content

Commit d07017f

Browse files
authored
Merge pull request #10 from SimCubeLtd/dev
maybe expansion will work under bash
2 parents 15bb62f + 00b9769 commit d07017f

File tree

3 files changed

+9
-20
lines changed

3 files changed

+9
-20
lines changed

src/SimCube.PulumiDeployments/GlobalUsings.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
global using System.Text.Json;
77
global using System.Text.Json.Serialization;
88
global using Ardalis.GuardClauses;
9-
global using CliWrap;
109
global using FluentValidation;
1110
global using FluentValidation.Results;
1211
global using Pulumi;

src/SimCube.PulumiDeployments/Resources/Helm/BaseHelmChartResource.cs

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
public abstract class BaseHelmChartResource : ComponentResource
77
{
88
protected readonly CustomResourceOptions CustomResourceOptions;
9-
10-
private const string EnvSubstituteCommand = "envsubst";
11-
private const string MoveCommand = "mv";
129
public const string HelmValuesFolder = "HelmValues";
1310

1411
protected BaseHelmChartResource(
@@ -31,21 +28,15 @@ protected string RenderYamlValues(Dictionary<string, string?> environmentalVaria
3128
{
3229
var helmValuesFile = GetHelmValuesFilePath();
3330

34-
Cli.Wrap(EnvSubstituteCommand)
35-
.WithArguments($"< {helmValuesFile} > {helmValuesFile}.new")
36-
.WithEnvironmentVariables(environmentalVariables)
37-
.WithValidation(CommandResultValidation.ZeroExitCode)
38-
.ExecuteAsync()
39-
.GetAwaiter()
40-
.GetResult();
41-
42-
Cli.Wrap(MoveCommand)
43-
.WithArguments($"{helmValuesFile}.new {helmValuesFile}")
44-
.WithEnvironmentVariables(environmentalVariables)
45-
.WithValidation(CommandResultValidation.ZeroExitCode)
46-
.ExecuteAsync()
47-
.GetAwaiter()
48-
.GetResult();
31+
foreach (var environmentalVariable in environmentalVariables)
32+
{
33+
Environment.SetEnvironmentVariable(environmentalVariable.Key, environmentalVariable.Value);
34+
}
35+
36+
var origin = File.ReadAllText(helmValuesFile);
37+
var output = Environment.ExpandEnvironmentVariables(origin);
38+
39+
File.WriteAllText(helmValuesFile, output);
4940

5041
return helmValuesFile;
5142
}

src/SimCube.PulumiDeployments/SimCube.PulumiDeployments.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
<ItemGroup>
1717
<PackageReference Include="Ardalis.GuardClauses" Version="4.0.1" />
18-
<PackageReference Include="CliWrap" Version="3.5.0" />
1918
<PackageReference Include="FluentValidation" Version="11.2.2" />
2019
<PackageReference Include="Pulumi.Kubernetes" Version="3.21.4" />
2120
<PackageReference Include="Pulumi.Command" Version="4.5.0" />

0 commit comments

Comments
 (0)