Skip to content

Commit

Permalink
[refactor-runner-adxt-783] env: Vars are exported and not passed to t…
Browse files Browse the repository at this point in the history
…he shell anymore
  • Loading branch information
CelianR committed Dec 18, 2024
1 parent 3656bda commit 36bcf5a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
28 changes: 13 additions & 15 deletions components/command/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ type Args struct {

func (args *Args) toLocalCommandArgs(config RunnerConfiguration, osCommand OSCommand) (*local.CommandArgs, error) {
return &local.CommandArgs{
Create: osCommand.BuildCommandString(args.Create, args.Environment, args.Sudo, args.RequirePasswordFromStdin, config.user),
Update: osCommand.BuildCommandString(args.Update, args.Environment, args.Sudo, args.RequirePasswordFromStdin, config.user),
Delete: osCommand.BuildCommandString(args.Delete, args.Environment, args.Sudo, args.RequirePasswordFromStdin, config.user),
Environment: args.Environment,
Triggers: args.Triggers,
Stdin: args.Stdin,
AssetPaths: args.LocalAssetPaths,
Dir: args.LocalDir,
Create: osCommand.BuildCommandString(args.Create, args.Environment, args.Sudo, args.RequirePasswordFromStdin, config.user),
Update: osCommand.BuildCommandString(args.Update, args.Environment, args.Sudo, args.RequirePasswordFromStdin, config.user),
Delete: osCommand.BuildCommandString(args.Delete, args.Environment, args.Sudo, args.RequirePasswordFromStdin, config.user),
Triggers: args.Triggers,
Stdin: args.Stdin,
AssetPaths: args.LocalAssetPaths,
Dir: args.LocalDir,
}, nil
}

Expand All @@ -50,13 +49,12 @@ func (args *Args) toRemoteCommandArgs(config RunnerConfiguration, osCommand OSCo
}

return &remote.CommandArgs{
Connection: config.connection,
Create: osCommand.BuildCommandString(args.Create, args.Environment, args.Sudo, args.RequirePasswordFromStdin, config.user),
Update: osCommand.BuildCommandString(args.Update, args.Environment, args.Sudo, args.RequirePasswordFromStdin, config.user),
Delete: osCommand.BuildCommandString(args.Delete, args.Environment, args.Sudo, args.RequirePasswordFromStdin, config.user),
Environment: args.Environment,
Triggers: args.Triggers,
Stdin: args.Stdin,
Connection: config.connection,
Create: osCommand.BuildCommandString(args.Create, args.Environment, args.Sudo, args.RequirePasswordFromStdin, config.user),
Update: osCommand.BuildCommandString(args.Update, args.Environment, args.Sudo, args.RequirePasswordFromStdin, config.user),
Delete: osCommand.BuildCommandString(args.Delete, args.Environment, args.Sudo, args.RequirePasswordFromStdin, config.user),
Triggers: args.Triggers,
Stdin: args.Stdin,
}, nil
}

Expand Down
2 changes: 1 addition & 1 deletion components/command/unixOSCommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (fs unixOSCommand) BuildCommandString(command pulumi.StringInput, env pulum

var envVars pulumi.StringArray
for varName, varValue := range env {
envVars = append(envVars, pulumi.Sprintf(`%v="%v"`, varName, varValue))
envVars = append(envVars, pulumi.Sprintf(`export %v="%v";`, varName, varValue))
}

return buildCommandString(formattedCommand, envVars, func(envVarsStr pulumi.StringOutput) pulumi.StringInput {
Expand Down

0 comments on commit 36bcf5a

Please sign in to comment.