-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add install command to automation api
- Add install command, with relevant version checks - Add Mock PulumiCommand for tests
- Loading branch information
1 parent
daeaab7
commit 5dd718e
Showing
6 changed files
with
199 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Pulumi.Automation.Events; | ||
using Pulumi.Automation.Commands; | ||
using Semver; | ||
|
||
namespace Pulumi.Automation.Tests.Mocks | ||
{ | ||
class PulumiCommandMock : PulumiCommand | ||
{ | ||
private readonly CommandResult CommandResult; | ||
|
||
public PulumiCommandMock(SemVersion version, CommandResult commandResult) | ||
{ | ||
this.Version = version; | ||
this.CommandResult = commandResult; | ||
} | ||
|
||
public override Task<CommandResult> RunAsync( | ||
IList<string> args, | ||
string workingDir, | ||
IDictionary<string, string?> additionalEnv, | ||
Action<string>? onStandardOutput = null, | ||
Action<string>? onStandardError = null, | ||
Action<EngineEvent>? onEngineEvent = null, | ||
CancellationToken cancellationToken = default) | ||
{ | ||
this.RecordedArgs = args; | ||
return Task.FromResult(this.CommandResult); | ||
} | ||
|
||
public override Task<CommandResult> RunInputAsync( | ||
IList<string> args, | ||
string workingDir, | ||
IDictionary<string, string?> additionalEnv, | ||
Action<string>? onStandardOutput = null, | ||
Action<string>? onStandardError = null, | ||
string? stdIn = null, | ||
Action<EngineEvent>? onEngineEvent = null, | ||
CancellationToken cancellationToken = default) | ||
{ | ||
this.RecordedArgs = args; | ||
return Task.FromResult(this.CommandResult); | ||
} | ||
|
||
public override SemVersion? Version { get; } | ||
|
||
public IList<string> RecordedArgs { get; private set; } = new List<string>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace Pulumi.Automation | ||
{ | ||
public class InstallOptions | ||
{ | ||
/// <summary> | ||
/// Skip installing plugins. | ||
/// </summary> | ||
public bool NoPlugins { get; set; } | ||
|
||
/// <summary> | ||
/// Skip installing dependencies. | ||
/// </summary> | ||
public bool NoDependencies { get; set; } | ||
|
||
/// <summary> | ||
/// Reinstall a plugin even if it already exists. | ||
/// </summary> | ||
public bool Reinstall { get; set; } | ||
|
||
/// <summary> | ||
/// Use language version tools to setup and install the language runtime. | ||
/// </summary> | ||
public bool UseLanguageVersionTools { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters