Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<HintPath>..\packages\Octopus.Manager.Core.3.14.0-ci0053\lib\Octopus.Manager.Core.dll</HintPath>
</Reference>
<Reference Include="Octopus.Shared, Version=3.14.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Octopus.Shared.3.14.2-scriptisolationm0003\lib\Octopus.Shared.dll</HintPath>
<HintPath>..\packages\Octopus.Shared.3.14.2-enh-scriptcomman0006\lib\Octopus.Shared.dll</HintPath>
</Reference>
<Reference Include="Octopus.Time, Version=1.0.9.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Octopus.Time.1.0.9\lib\netstandard1.0\Octopus.Time.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion source/Octopus.Manager.Tentacle/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<package id="Octopus.Configuration" version="1.0.11" targetFramework="net45" />
<package id="Octopus.Diagnostics" version="1.0.12" targetFramework="net45" />
<package id="Octopus.Manager.Core" version="3.14.0-ci0053" targetFramework="net45" />
<package id="Octopus.Shared" version="3.14.2-scriptisolationm0003" targetFramework="net45" />
<package id="Octopus.Shared" version="3.14.2-enh-scriptcomman0006" targetFramework="net45" />
<package id="Octopus.Time" version="1.0.9" targetFramework="net45" />
<package id="System.Net.Http" version="4.1.0" targetFramework="net45" />
<package id="System.Runtime" version="4.1.0" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using System.Threading;
using FluentAssertions;
using NSubstitute;
using NUnit.Framework;
using Octopus.Shared.Configuration;
Expand Down Expand Up @@ -50,8 +51,9 @@ public void ShouldPingLocalhostSuccessfully()
[Test]
public void ShouldPingRandomUnsuccessfully()
{
var guid = Guid.NewGuid();
var startScriptCommand = new StartScriptCommandBuilder()
.WithScriptBody("& ping.exe " + Guid.NewGuid() + " -n 1")
.WithScriptBody($"& ping.exe {guid} -n 1")
.Build();

var ticket = service.StartScript(startScriptCommand);
Expand All @@ -65,7 +67,7 @@ public void ShouldPingRandomUnsuccessfully()
DumpLog(finalStatus);
Assert.That(finalStatus.State, Is.EqualTo(ProcessState.Complete));
Assert.That(finalStatus.ExitCode, Is.Not.EqualTo(0));
Assert.That(finalStatus.Logs[0].Text, Is.StringContaining("Ping request could not find host"));
finalStatus.Logs.Select(l => l.Text).Should().Contain($"Ping request could not find host {guid}. Please check the name and try again.");
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
<HintPath>..\packages\Octopus.Diagnostics.1.0.12\lib\netstandard1.0\Octopus.Diagnostics.dll</HintPath>
</Reference>
<Reference Include="Octopus.Shared, Version=3.14.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Octopus.Shared.3.14.2-scriptisolationm0003\lib\Octopus.Shared.dll</HintPath>
<HintPath>..\packages\Octopus.Shared.3.14.2-enh-scriptcomman0006\lib\Octopus.Shared.dll</HintPath>
</Reference>
<Reference Include="Octopus.Time, Version=1.0.9.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Octopus.Time.1.0.9\lib\netstandard1.0\Octopus.Time.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion source/Octopus.Tentacle.Tests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<package id="Octopus.Diagnostics" version="1.0.12" targetFramework="net452" />
<package id="Octopus.Server.Extensibility" version="2.0.2" targetFramework="net452" />
<package id="Octopus.Server.Extensibility.Authentication" version="3.0.0" targetFramework="net452" />
<package id="Octopus.Shared" version="3.14.2-scriptisolationm0003" targetFramework="net452" />
<package id="Octopus.Shared" version="3.14.2-enh-scriptcomman0006" targetFramework="net452" />
<package id="Octopus.Time" version="1.0.9" targetFramework="net452" />
<package id="Octostache" version="2.1.5" targetFramework="net452" />
<package id="Polly" version="5.1.0" targetFramework="net452" />
Expand Down
2 changes: 1 addition & 1 deletion source/Octopus.Tentacle/Octopus.Tentacle.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ItemGroup>
<PackageReference Include="Autofac" Version="3.5.2" />
<PackageReference Include="Octopus.Client" Version="4.15.6" />
<PackageReference Include="Octopus.Shared" Version="3.14.2-scriptisolationm0003" />
<PackageReference Include="Octopus.Shared" Version="3.14.2-enh-scriptcomman0006" />
<PackageReference Include="System.Net.Http" Version="4.1.0" />
</ItemGroup>

Expand Down
10 changes: 5 additions & 5 deletions source/Octopus.Tentacle/Services/Scripts/ScriptService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ public ScriptService(IScriptWorkspaceFactory workspaceFactory, IOctopusFileSyste

public ScriptTicket StartScript(StartScriptCommand command)
{
var ticket = ScriptTicket.Create();
var ticket = ScriptTicket.Create(command.TaskId);
var workspace = PrepareWorkspace(command, ticket);
var cancel = new CancellationTokenSource();
var process = LaunchPowerShell(ticket, workspace, cancel);
var process = LaunchPowerShell(ticket, command.TaskId, workspace, cancel);
running.TryAdd(ticket.TaskId, process);
cancellationTokens.TryAdd(ticket.TaskId, cancel);
return ticket;
Expand Down Expand Up @@ -70,11 +70,11 @@ IScriptLog CreateLog(IScriptWorkspace workspace)
return new ScriptLog(workspace.ResolvePath("Output.log"), fileSystem);
}

RunningScript LaunchPowerShell(ScriptTicket ticket, IScriptWorkspace workspace, CancellationTokenSource cancel)
RunningScript LaunchPowerShell(ScriptTicket ticket, string serverTaskId, IScriptWorkspace workspace, CancellationTokenSource cancel)
{
var runningScript = new RunningScript(workspace, CreateLog(workspace), ticket.TaskId, cancel.Token);
var runningScript = new RunningScript(workspace, CreateLog(workspace), serverTaskId, cancel.Token);
var thread = new Thread(runningScript.Execute);
thread.Name = "Executing PowerShell script for " + ticket.TaskId;
thread.Name = "Executing PowerShell script for " + ticket;
thread.Start();
return runningScript;
}
Expand Down