aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-02-18 11:33:30 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-02-18 11:33:30 +0200
commit8c203b26d50818a1b16b2a7ec48eca7b082653f4 (patch)
treea89d88546960dbe05271eb587a25001fb767c638 /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update
parent21cdc1e12814f72e6aac795f9ddd2a32b9614389 (diff)
downloadTango-8c203b26d50818a1b16b2a7ec48eca7b082653f4.tar.gz
Tango-8c203b26d50818a1b16b2a7ec48eca7b082653f4.zip
Implemented new Machine Studio Publish CLI and UI.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update')
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/IMachineStudioUpdateService.cs3
-rw-r--r--Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs13
2 files changed, 11 insertions, 5 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/IMachineStudioUpdateService.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/IMachineStudioUpdateService.cs
index f9462009a..375506b90 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/IMachineStudioUpdateService.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/IMachineStudioUpdateService.cs
@@ -6,11 +6,14 @@ using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using Tango.MachineStudio.Common.Update;
+using Tango.Web;
namespace Tango.MachineStudio.Common.Update
{
public interface IMachineStudioUpdateService
{
+ DeploymentSlot Environment { get; set; }
+
Task<CheckForUpdatesResponse> CheckForUpdates(CheckForUpdatesRequest request);
Task<DownloadLatestVersionResponse> DownloadLatestVersion(DownloadLatestVersionRequest request);
diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs
index 79dd2ec96..8fdd18abe 100644
--- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs
+++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs
@@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using Tango.Settings;
using Tango.Transport.Web;
+using Tango.Web;
namespace Tango.MachineStudio.Common.Update
{
@@ -12,9 +13,11 @@ namespace Tango.MachineStudio.Common.Update
{
private WebTransportClient _client;
+ public DeploymentSlot Environment { get; set; }
+
public MachineStudioUpdateService()
{
-
+ Environment = SettingsManager.Default.GetOrCreate<MachineStudioSettings>().DeploymentSlot;
_client = new WebTransportClient();
}
@@ -38,14 +41,14 @@ namespace Tango.MachineStudio.Common.Update
return _client.PostJson<LatestVersionRequest, LatestVersionResponse>(GetAddress() + "GetLatestVersion", request);
}
- private String GetAddress()
+ public Task<DownloadLatestVersionResponse> DownloadLatestVersion(DownloadLatestVersionRequest request)
{
- return SettingsManager.Default.GetOrCreate<MachineStudioSettings>().GetMachineServiceAddress() + "/api/MachineStudio/";
+ return _client.PostJson<DownloadLatestVersionRequest, DownloadLatestVersionResponse>(GetAddress() + "DownloadLatestVersion", request);
}
- public Task<DownloadLatestVersionResponse> DownloadLatestVersion(DownloadLatestVersionRequest request)
+ private String GetAddress()
{
- return _client.PostJson<DownloadLatestVersionRequest, DownloadLatestVersionResponse>(GetAddress() + "DownloadLatestVersion", request);
+ return Environment.ToAddress() + "/api/MachineStudio/";
}
}
}