aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-02-25 18:18:35 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-02-25 18:18:35 +0200
commite112866a2cf44ddeb5b40e8ffc84614ecfe6abdf (patch)
tree48614b95fe9e3d549a465a7b381f432c21a0fef8 /Software/Visual_Studio/PPC/Tango.PPC.Common
parent08d9858ecd0d4adb0c9c6076d7d2b1216e8f64c3 (diff)
downloadTango-e112866a2cf44ddeb5b40e8ffc84614ecfe6abdf.tar.gz
Tango-e112866a2cf44ddeb5b40e8ffc84614ecfe6abdf.zip
Implemented auto installer release for machine studio and PPC.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs43
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs24
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj6
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionRequest.cs2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionResponse.cs2
5 files changed, 67 insertions, 10 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs
index 65709d46f..7c6113829 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PPCPublisher.cs
@@ -5,7 +5,9 @@ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
+using System.Threading;
using System.Threading.Tasks;
+using Tango.AdvancedInstaller;
using Tango.Core;
using Tango.Core.Helpers;
using Tango.PPC.Common.Web;
@@ -136,6 +138,19 @@ namespace Tango.PPC.Common.Publish
throw new FileNotFoundException($"Could not locate the PPC executable at {appPath}.");
}
+ if (!String.IsNullOrWhiteSpace(Options.InstallerProject))
+ {
+ if (!File.Exists(Options.InstallerProject))
+ {
+ throw new FileNotFoundException($"Installer project not found at '{Options.InstallerProject}'.");
+ }
+
+ if (!Directory.Exists(Options.InstallerOutputFolder))
+ {
+ throw new DirectoryNotFoundException($"Installer output folder does not exists '{Options.InstallerOutputFolder}'.");
+ }
+ }
+
return Task.Factory.StartNew(() =>
{
String tempFile = TemporaryManager.CreateFile(".zip");
@@ -165,8 +180,34 @@ namespace Tango.PPC.Common.Publish
Comments = Options.Comments,
Version = local_version,
MachineVersionGuid = Options.MachineVersionGuid,
+ WithInstaller = !String.IsNullOrWhiteSpace(Options.InstallerProject),
}).Result;
+
+ if (!String.IsNullOrWhiteSpace(Options.InstallerProject))
+ {
+ String output_folder = Options.InstallerOutputFolder;
+ OnPublishProgress(0, 100, $"Building installer project...");
+ InstallerBuilder installerBuilder = new InstallerBuilder(Options.InstallerProject);
+ String installer_name = $"PPC Installer_v{Version.Parse(local_version).ToString(3)}.exe";
+ String output_file = Path.Combine(output_folder, installer_name);
+ installerBuilder.Build(local_version, output_file).Wait();
+
+ Thread.Sleep(5000);
+
+ OnPublishProgress(0, 100, $"Uploading installer '{installer_name}'...");
+
+ using (StorageBlobUploader uploader = new StorageBlobUploader(response.InstallerBlobAddress, output_file))
+ {
+ uploader.Progress += (x, e) =>
+ {
+ OnPublishProgress(e.Current, e.Total, $"Uploading installer {(((double)e.Current / (double)e.Total) * 100d).ToString("0.0")}%...", true);
+ };
+
+ uploader.Upload().Wait();
+ }
+ }
+
CreateTupPackage(tempFile).Wait();
OnPublishProgress(0, 100, $"Starting version upload...");
@@ -177,7 +218,7 @@ namespace Tango.PPC.Common.Publish
{
InvokeUINow(() =>
{
- OnPublishProgress(e.Current, e.Total, $"Uploading to storage {(((double)e.Current / (double)e.Total) * 100d).ToString("0.0")}%...", true);
+ OnPublishProgress(e.Current, e.Total, $"Uploading version {(((double)e.Current / (double)e.Total) * 100d).ToString("0.0")}%...", true);
});
};
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs
index fa04d8331..4c40acb44 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Publish/PublishOptions.cs
@@ -66,14 +66,6 @@ namespace Tango.PPC.Common.Publish
set { _environment = value; RaisePropertyChangedAuto(); EnvironmentChanged?.Invoke(this, new EventArgs()); }
}
- private String _installerProject;
- [Option("installer-project-file", HelpText = "Specifies the advanced installer project file to build and upload.", Required = false)]
- public String InstallerProject
- {
- get { return _installerProject; }
- set { _installerProject = value; RaisePropertyChangedAuto(); }
- }
-
private String _machineVersionGuid;
[Option("machine-version-guid", HelpText = "Specifies the machine version id for which to upload the PPC version.", Required = true)]
public String MachineVersionGuid
@@ -90,6 +82,22 @@ namespace Tango.PPC.Common.Publish
set { _tfpPath = value; RaisePropertyChangedAuto(); }
}
+ private String _installerProject;
+ [Option("installer-project-file", HelpText = "Specifies the advanced installer project file to build and upload.", Required = false)]
+ public String InstallerProject
+ {
+ get { return _installerProject; }
+ set { _installerProject = value; RaisePropertyChangedAuto(); }
+ }
+
+ private String _installerOutputFolder;
+ [Option("installer-output-folder", HelpText = "Specifies where to save the installer application.", Required = false)]
+ public String InstallerOutputFolder
+ {
+ get { return _installerOutputFolder; }
+ set { _installerOutputFolder = value; RaisePropertyChangedAuto(); }
+ }
+
private SynchronizationOptions _synchronization;
public SynchronizationOptions Synchronization
{
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
index fe2f87fb2..07ea6c5d1 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
@@ -285,6 +285,10 @@
</None>
</ItemGroup>
<ItemGroup>
+ <ProjectReference Include="..\..\Tango.AdvancedInstaller\Tango.AdvancedInstaller.csproj">
+ <Project>{c5df1816-34e5-4700-824c-29623a1baa22}</Project>
+ <Name>Tango.AdvancedInstaller</Name>
+ </ProjectReference>
<ProjectReference Include="..\..\Tango.BL\Tango.BL.csproj">
<Project>{f441feee-322a-4943-b566-110e12fd3b72}</Project>
<Name>Tango.BL</Name>
@@ -367,7 +371,7 @@
</Target>
<ProjectExtensions>
<VisualStudio>
- <UserProperties BuildVersion_StartDate="2000/1/1" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" />
+ <UserProperties BuildVersion_AssemblyInfoFilename="Properties\AssemblyInfo.cs" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.None.Increment.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_StartDate="2000/1/1" />
</VisualStudio>
</ProjectExtensions>
</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionRequest.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionRequest.cs
index d75a94300..29d533043 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionRequest.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionRequest.cs
@@ -15,5 +15,7 @@ namespace Tango.PPC.Common.Web
public String MachineVersionGuid { get; set; }
public String Comments { get; set; }
+
+ public bool WithInstaller { get; set; }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionResponse.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionResponse.cs
index 9a0fc1a5f..0b4859915 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionResponse.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Web/UploadVersionResponse.cs
@@ -13,5 +13,7 @@ namespace Tango.PPC.Common.Web
public String Token { get; set; }
public String BlobAddress { get; set; }
+
+ public String InstallerBlobAddress { get; set; }
}
}