From 9e42e1c87f3a206f0babc74760ac9a02d8d328f4 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Thu, 27 Dec 2018 15:14:10 +0200 Subject: Implemented Deployment Slots! Implemented Environment AD Groups. Implemented Machine Studio environment selection. --- .../Tango.MachineStudio.Common/DeploymentSlots.cs | 21 +++++++++++++++++++++ .../MachineStudioSettings.cs | 22 ++++++++++++++++------ .../Tango.MachineStudio.Common.csproj | 1 + .../Update/MachineStudioUpdateService.cs | 2 +- 4 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/DeploymentSlots.cs (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/DeploymentSlots.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/DeploymentSlots.cs new file mode 100644 index 000000000..857f1e5ba --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/DeploymentSlots.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Tango.MachineStudio.Common +{ + public enum DeploymentSlots + { + [Description("https://machineservice-dev.twine-srv.com")] + Development, + [Description("https://machineservice-test.twine-srv.com")] + Testing, + [Description("https://machineservice-stage.twine-srv.com")] + Staging, + [Description("https://machineservice.twine-srv.com")] + Production + } +} diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs index 2de954cbe..cbaeb9d2e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/MachineStudioSettings.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -44,11 +45,6 @@ namespace Tango.MachineStudio.Common /// public String LastVirtualMachineSerialNumber { get; set; } - /// - /// Gets or sets the machine service address. - /// - public String MachineServiceAddress { get; set; } - /// /// Gets or sets the allow beta release. /// @@ -99,6 +95,20 @@ namespace Tango.MachineStudio.Common /// public WorkingEnvironment Environment { get; set; } + /// + /// Gets or sets the deployment slot. + /// + public DeploymentSlots DeploymentSlot { get; set; } + + /// + /// Gets the machine service address. + /// + /// + public String GetMachineServiceAddress() + { + return DeploymentSlot.ToDescription(); + } + /// /// Initializes a new instance of the class. /// @@ -106,10 +116,10 @@ namespace Tango.MachineStudio.Common { LastBounds = new Rect(); LoggingCategories = new List(); - MachineServiceAddress = "http://machineservice.twine-srv.com/"; DefaultIssueReportTags = new List(); StudioModulesBounds = new List(); Environment = WorkingEnvironment.Remote; + DeploymentSlot = DeploymentSlots.Development; } } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj index 85b194173..58a0d5f7e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Tango.MachineStudio.Common.csproj @@ -94,6 +94,7 @@ + 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 aae1fe70d..77828d490 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Update/MachineStudioUpdateService.cs @@ -15,7 +15,7 @@ namespace Tango.MachineStudio.Common.Update public MachineStudioUpdateService() { - address = SettingsManager.Default.GetOrCreate().MachineServiceAddress + "/api/MachineStudio/"; + address = SettingsManager.Default.GetOrCreate().GetMachineServiceAddress() + "/api/MachineStudio/"; _client = new WebTransportClient(); } -- cgit v1.3.1