diff options
| author | Roy <Roy.mail.net@gmail.com> | 2022-11-20 19:06:28 +0200 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2022-11-20 19:06:28 +0200 |
| commit | 7c7e27fad7deb4c82a5ca7e5cb19184fa324b8d5 (patch) | |
| tree | 4ebd799531535c2415e9640d2a17e9763c83e2df /Software | |
| parent | fa2c00989b50258d1195925030ed1da2a1d6d040 (diff) | |
| download | Tango-7c7e27fad7deb4c82a5ca7e5cb19184fa324b8d5.tar.gz Tango-7c7e27fad7deb4c82a5ca7e5cb19184fa324b8d5.zip | |
AzureUtils PPC VersionTag kind of working.
Diffstat (limited to 'Software')
12 files changed, 84 insertions, 50 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex 5cfd85867..11e1a8b81 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex c500561d4..0623f9557 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml index aadd7a6d8..40c1b8223 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml @@ -57,7 +57,7 @@ <TextBlock Text="{Binding ElementName=control,Path=MachineStudioVersion.Version}"></TextBlock> <TextBlock FontWeight="SemiBold">Tango Application Version:</TextBlock> - <TextBlock Text="{Binding ElementName=control,Path=TangoVersion.Version}"></TextBlock> + <TextBlock Text="{Binding ElementName=control,Path=TangoVersion.VersionAndTag}"></TextBlock> <TextBlock FontWeight="SemiBold">Tango Firmware Version::</TextBlock> <TextBlock Text="{Binding ElementName=control,Path=TangoVersion.FirmwareVersion}"></TextBlock> diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml.cs index a0e01e160..51303d126 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml.cs +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Controls/WebAppPropertiesControl.xaml.cs @@ -26,6 +26,22 @@ namespace Tango.AzureUtils.UI.Controls /// </summary> public partial class WebAppPropertiesControl : UserControl { + public IWebAppBase WebApp + { + get { return (IWebAppBase)GetValue(WebAppProperty); } + set { SetValue(WebAppProperty, value); } + } + public static readonly DependencyProperty WebAppProperty = + DependencyProperty.Register("WebApp", typeof(IWebAppBase), typeof(WebAppPropertiesControl), new PropertyMetadata(null, (d, e) => (d as WebAppPropertiesControl).UpdateControl())); + + public String PPCVersionTag + { + get { return (String)GetValue(PPCVersionTagProperty); } + set { SetValue(PPCVersionTagProperty, value); } + } + public static readonly DependencyProperty PPCVersionTagProperty = + DependencyProperty.Register("PPCVersionTag", typeof(String), typeof(WebAppPropertiesControl), new PropertyMetadata(null, (d, e) => (d as WebAppPropertiesControl).UpdateControl())); + public MachineServiceSettings Settings { get { return (MachineServiceSettings)GetValue(SettingsProperty); } @@ -99,15 +115,18 @@ namespace Tango.AzureUtils.UI.Controls public WebAppPropertiesControl() { InitializeComponent(); + } - DataContextChanged += WebAppPropertiesControl_DataContextChanged; + private void WebAppPropertiesControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) + { + UpdateControl(); } - private async void WebAppPropertiesControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e) + private async void UpdateControl() { - if (DataContext != null && DataContext is IWebAppBase) + if (WebApp != null && WebApp is IWebAppBase) { - IWebAppBase app = DataContext as IWebAppBase; + IWebAppBase app = WebApp as IWebAppBase; try { @@ -124,7 +143,7 @@ namespace Tango.AzureUtils.UI.Controls var azure = await AzureUtilsAuthenticationFactory.AuthenticateOrGetAsync(); var databaseManager = new DatabaseManager(azure); - TangoVersion = await databaseManager.GetLatestPPCVersion(app); + TangoVersion = await databaseManager.GetLatestPPCVersion(app, PPCVersionTag); MachineStudioVersion = await databaseManager.GetLatestMachineStudioVersion(app); FseVersion = await databaseManager.GetLatestFSEVersion(app, FSEBuildVariants.FSE); TwineRSMVersion = await databaseManager.GetLatestFSEVersion(app, FSEBuildVariants.TwineRSM); diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/EnvironmentFirmwareUpgradeViewVM.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/EnvironmentFirmwareUpgradeViewVM.cs index 964febbd8..931182c90 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/EnvironmentFirmwareUpgradeViewVM.cs +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/ViewModels/EnvironmentFirmwareUpgradeViewVM.cs @@ -51,7 +51,7 @@ namespace Tango.AzureUtils.UI.ViewModels public EnvironmentFirmwareUpgradeViewVM() { - UpgradeFirmwareCommand = new RelayCommand(UpgradeFirmware,() => FilePath != null); + UpgradeFirmwareCommand = new RelayCommand(UpgradeFirmware, () => FilePath != null); BrowseFileCommand = new RelayCommand(BrowseFile); } @@ -93,7 +93,7 @@ namespace Tango.AzureUtils.UI.ViewModels IsFree = false; - await _firmwareManager.InjectFirmwarePackage(SelectedDeploymentSlot, FilePath); + await _firmwareManager.InjectFirmwarePackage(SelectedDeploymentSlot, FilePath, null); } catch (Exception ex) { diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/EnvironmentUpgradeView.xaml b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/EnvironmentUpgradeView.xaml index 249dbabc6..5b6491a48 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/EnvironmentUpgradeView.xaml +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils.UI/Views/EnvironmentUpgradeView.xaml @@ -32,7 +32,7 @@ </ComboBox.ItemTemplate> </ComboBox> - <localControls:WebAppPropertiesControl VerticalAlignment="Top" Margin="0 20 0 0" DataContext="{Binding SelectedSourceApp}" /> + <localControls:WebAppPropertiesControl VerticalAlignment="Top" Margin="0 20 0 0" PPCVersionTag="{Binding Config.PPCVersionTag}" WebApp="{Binding SelectedSourceApp}" /> </DockPanel> </GroupBox> </Grid> @@ -52,6 +52,11 @@ <CheckBox Click="OnConfigChanged" Margin="0 5 0 0" IsChecked="{Binding Config.CopyTwineRSMStorageBlobs}" >Upgrade Twine RSM Blob Storage</CheckBox> <CheckBox Click="OnConfigChanged" Margin="0 5 0 0" IsChecked="{Binding Config.UpgradeTwineRSMDatabaseVersion}" >Upgrade Twine RSM Database Version</CheckBox> <CheckBox Click="OnConfigChanged" Margin="0 5 0 0" IsChecked="{Binding Config.CopyMachineServiceFiles}" >Upgrade Machine Service</CheckBox> + + <StackPanel Margin="0 5 0 0"> + <TextBlock FontSize="10">PPC Version Tag</TextBlock> + <TextBox x:Name="txtPPCVersionTag" Text="{Binding Config.PPCVersionTag,Mode=TwoWay,Delay=500,UpdateSourceTrigger=PropertyChanged}"></TextBox> + </StackPanel> </StackPanel> </GroupBox> @@ -75,7 +80,7 @@ </ComboBox.ItemTemplate> </ComboBox> - <localControls:WebAppPropertiesControl VerticalAlignment="Top" Margin="0 20 0 0" DataContext="{Binding SelectedTargetApp}" /> + <localControls:WebAppPropertiesControl VerticalAlignment="Top" Margin="0 20 0 0" PPCVersionTag="{Binding Config.PPCVersionTag}" WebApp="{Binding SelectedTargetApp}" /> </DockPanel> </GroupBox> </Grid> diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils/Database/DatabaseManager.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils/Database/DatabaseManager.cs index 836e66c9f..4202b45a7 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils/Database/DatabaseManager.cs +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils/Database/DatabaseManager.cs @@ -229,13 +229,13 @@ namespace Tango.AzureUtils.Database } } - public async Task UpgradePPCVersion(IWebAppBase sourceApp, IWebAppBase targetApp) + public async Task UpgradePPCVersion(IWebAppBase sourceApp, IWebAppBase targetApp, String versionTag) { - var latestPPCVersion = await GetLatestPPCVersion(sourceApp); + var latestPPCVersion = await GetLatestPPCVersion(sourceApp, versionTag); var targetDataSource = (await targetApp.GetMachineServiceSettingsAsync()).ToDataSource(); - OnProgress(AzureUtilsStage.Database, $"Adding PPC database entry for version '{latestPPCVersion.Version}'..."); + OnProgress(AzureUtilsStage.Database, $"Adding PPC database entry for version '{latestPPCVersion.VersionAndTag}'..."); using (var db = ObservablesContext.CreateDefault(targetDataSource)) { @@ -274,12 +274,12 @@ namespace Tango.AzureUtils.Database } } - public async Task DowngradePPCVersion(IWebAppBase app) + public async Task DowngradePPCVersion(IWebAppBase app, String versionTag) { - var latestPPCVersion = await GetLatestPPCVersion(app); + var latestPPCVersion = await GetLatestPPCVersion(app, versionTag); var dataSource = (await app.GetMachineServiceSettingsAsync()).ToDataSource(); - OnProgress(AzureUtilsStage.Database, $"Removing PPC database entry for version '{latestPPCVersion.Version}'..."); + OnProgress(AzureUtilsStage.Database, $"Removing PPC database entry for version '{latestPPCVersion.VersionAndTag}'..."); using (var db = ObservablesContext.CreateDefault(dataSource)) { @@ -321,7 +321,7 @@ namespace Tango.AzureUtils.Database } } - public async Task<TangoVersion> GetLatestPPCVersion(IWebAppBase app) + public async Task<TangoVersion> GetLatestPPCVersion(IWebAppBase app, String versionTag) { OnProgress(AzureUtilsStage.Database, $"Getting latest PPC version on '{app.Name}'..."); @@ -342,7 +342,7 @@ namespace Tango.AzureUtils.Database using (var db = ObservablesContext.CreateDefault(dataSource)) { - var versions = await db.TangoVersions.ToListAsync(); + var versions = await db.TangoVersions.Where(x => x.Tag == versionTag).ToListAsync(); var latest_version = versions.OrderByDescending(x => Version.Parse(x.Version)).FirstOrDefault(); return latest_version; } @@ -409,14 +409,14 @@ namespace Tango.AzureUtils.Database } } - public async Task ValidatePPCDatabaseUpgrade(IWebAppBase sourceApp, IWebAppBase targetApp) + public async Task ValidatePPCDatabaseUpgrade(IWebAppBase sourceApp, IWebAppBase targetApp, String versionTag) { OnProgress(AzureUtilsStage.Validating, "Validating PPC database upgrade..."); var sourceSettings = await sourceApp.GetMachineServiceSettingsAsync(); var targetSettings = await targetApp.GetMachineServiceSettingsAsync(); - var latestSourcePPCVersion = await GetLatestPPCVersion(sourceApp); + var latestSourcePPCVersion = await GetLatestPPCVersion(sourceApp, versionTag); //Check if there is any source PPC version. if (latestSourcePPCVersion == null) @@ -424,12 +424,12 @@ namespace Tango.AzureUtils.Database throw new ValidationException("Could not locate a PPC version entry on the source database."); } - var latestTargetPPCVersion = await GetLatestPPCVersion(targetApp); + var latestTargetPPCVersion = await GetLatestPPCVersion(targetApp, versionTag); //Check target latest PPC version is older if there is any. if (latestTargetPPCVersion != null && Version.Parse(latestSourcePPCVersion.Version) <= Version.Parse(latestTargetPPCVersion.Version)) { - throw new ValidationException($"PPC source version is '{latestSourcePPCVersion.Version}' while target version is '{latestTargetPPCVersion.Version}'."); + throw new ValidationException($"PPC source version is '{latestSourcePPCVersion.VersionAndTag}' while target version is '{latestTargetPPCVersion.VersionAndTag}'."); } } diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils/Environment/EnvironmentManager.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils/Environment/EnvironmentManager.cs index 4806bc8c8..01c95a566 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils/Environment/EnvironmentManager.cs +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils/Environment/EnvironmentManager.cs @@ -195,8 +195,8 @@ namespace Tango.AzureUtils.Environment //Add PPC storage versions. try { - await _storageManager.ValidatePPCStorageUpgrade(sourceSlot, slot); - await _storageManager.UpgradePPCStorage(sourceSlot, slot); + await _storageManager.ValidatePPCStorageUpgrade(sourceSlot, slot, null); + await _storageManager.UpgradePPCStorage(sourceSlot, slot, null); } catch (Exception ex) { @@ -319,8 +319,8 @@ namespace Tango.AzureUtils.Environment { try { - await _storageManager.ValidatePPCStorageUpgrade(sourceApp, targetApp); - await _storageManager.UpgradePPCStorage(sourceApp, targetApp); + await _storageManager.ValidatePPCStorageUpgrade(sourceApp, targetApp, config.PPCVersionTag); + await _storageManager.UpgradePPCStorage(sourceApp, targetApp, config.PPCVersionTag); } catch (Exception ex) { @@ -375,8 +375,8 @@ namespace Tango.AzureUtils.Environment { try { - await _databaseManager.ValidatePPCDatabaseUpgrade(sourceApp, targetApp); - await _databaseManager.UpgradePPCVersion(sourceApp, targetApp); + await _databaseManager.ValidatePPCDatabaseUpgrade(sourceApp, targetApp, config.PPCVersionTag); + await _databaseManager.UpgradePPCVersion(sourceApp, targetApp, config.PPCVersionTag); } catch (Exception ex) { @@ -442,7 +442,7 @@ namespace Tango.AzureUtils.Environment //Add PPC storage versions. if (config.CopyPPCStorageBlobs) { - await _storageManager.ValidatePPCStorageUpgrade(sourceApp, targetApp); + await _storageManager.ValidatePPCStorageUpgrade(sourceApp, targetApp, config.PPCVersionTag); } //Add FSE storage versions. @@ -466,7 +466,7 @@ namespace Tango.AzureUtils.Environment //Upgrade PPC database version. if (config.UpgradePPCDatabaseVersion) { - await _databaseManager.ValidatePPCDatabaseUpgrade(sourceApp, targetApp); + await _databaseManager.ValidatePPCDatabaseUpgrade(sourceApp, targetApp, config.PPCVersionTag); } //Upgrade FSE database version. @@ -583,7 +583,7 @@ namespace Tango.AzureUtils.Environment { try { - await _storageManager.DowngradePPCStorage(app); + await _storageManager.DowngradePPCStorage(app, config.PPCVersionTag); } catch (Exception ex) { @@ -592,7 +592,7 @@ namespace Tango.AzureUtils.Environment try { - await _databaseManager.DowngradePPCVersion(app); + await _databaseManager.DowngradePPCVersion(app, config.PPCVersionTag); } catch (Exception ex) { diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils/Environment/RollbackEnvironmentConfiguration.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils/Environment/RollbackEnvironmentConfiguration.cs index da0f68aac..7811a73bb 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils/Environment/RollbackEnvironmentConfiguration.cs +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils/Environment/RollbackEnvironmentConfiguration.cs @@ -11,5 +11,7 @@ namespace Tango.AzureUtils.Environment public bool RollbackMachineStudio { get; set; } public bool RollbackPPC { get; set; } + + public String PPCVersionTag { get; set; } } } diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils/Environment/UpgradeEnvironmentConfiguration.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils/Environment/UpgradeEnvironmentConfiguration.cs index 44cde7731..b165fb6b0 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils/Environment/UpgradeEnvironmentConfiguration.cs +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils/Environment/UpgradeEnvironmentConfiguration.cs @@ -3,10 +3,11 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.Core; namespace Tango.AzureUtils.Environment { - public class UpgradeEnvironmentConfiguration + public class UpgradeEnvironmentConfiguration : ExtendedObject { public bool SynchronizeDatabaseSchema { get; set; } public bool SynchronizeDatabaseData { get; set; } @@ -19,5 +20,12 @@ namespace Tango.AzureUtils.Environment public bool CopyTwineRSMStorageBlobs { get; set; } public bool UpgradeTwineRSMDatabaseVersion { get; set; } public bool CopyMachineServiceFiles { get; set; } + private String _ppcVersionTag; + public String PPCVersionTag + { + get { return _ppcVersionTag.IsNotNullOrEmpty() ? _ppcVersionTag : null; } + set { _ppcVersionTag = value; RaisePropertyChangedAuto(); } + } + } } diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils/Firmware/FirmwareManager.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils/Firmware/FirmwareManager.cs index eb073f7a2..ac8e52a65 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils/Firmware/FirmwareManager.cs +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils/Firmware/FirmwareManager.cs @@ -30,7 +30,7 @@ namespace Tango.AzureUtils.Firmware #region Firmware Injection - public async Task InjectFirmwarePackage(IWebAppBase slot, String tfpFile) + public async Task InjectFirmwarePackage(IWebAppBase slot, String tfpFile, String versionTag) { OnProgress(AzureUtilsStage.Firmware, $"Validating TFP package..."); @@ -46,7 +46,7 @@ namespace Tango.AzureUtils.Firmware throw new ValidationException($"The specified TFP package is invalid.\n{ex.FlattenMessage()}"); } - var ppcVersion = await _databaseManager.GetLatestPPCVersion(slot); + var ppcVersion = await _databaseManager.GetLatestPPCVersion(slot, null); if (Version.Parse(ppcVersion.FirmwareVersion) >= tfpPackage.GetMcuVersion()) { @@ -60,7 +60,7 @@ namespace Tango.AzureUtils.Firmware var zipFile = TemporaryManager.CreateImaginaryFile(".zip"); - await _storageManager.DownloadLatestPPCVersion(slot, zipFile); + await _storageManager.DownloadLatestPPCVersion(slot, zipFile, versionTag); OnProgress(AzureUtilsStage.Firmware, $"Replacing firmware_package.tfp..."); await Task.Factory.StartNew(() => @@ -84,7 +84,7 @@ namespace Tango.AzureUtils.Firmware } }); - await _storageManager.ReplaceLatestPPCVersion(slot, zipFile); + await _storageManager.ReplaceLatestPPCVersion(slot, zipFile, versionTag); OnProgress(AzureUtilsStage.Firmware, $"Updating firmware version on database..."); using (ObservablesContext db = ObservablesContext.CreateDefault(settings.ToDataSource())) diff --git a/Software/Visual_Studio/Azure/Tango.AzureUtils/Storage/StorageManager.cs b/Software/Visual_Studio/Azure/Tango.AzureUtils/Storage/StorageManager.cs index 5ff7af246..887b0ec63 100644 --- a/Software/Visual_Studio/Azure/Tango.AzureUtils/Storage/StorageManager.cs +++ b/Software/Visual_Studio/Azure/Tango.AzureUtils/Storage/StorageManager.cs @@ -77,14 +77,14 @@ namespace Tango.AzureUtils.Storage await blob.DeleteAsync(); } - public async Task UpgradePPCStorage(IWebAppBase sourceApp, IWebAppBase targetApp) + public async Task UpgradePPCStorage(IWebAppBase sourceApp, IWebAppBase targetApp, String versionTag) { OnProgress(AzureUtilsStage.Storage, $"Retrieving source and target settings..."); var sourceSettings = await sourceApp.GetMachineServiceSettingsAsync(); var targetSettings = await targetApp.GetMachineServiceSettingsAsync(); - var latestPPCVersion = await _databaseManager.GetLatestPPCVersion(sourceApp); + var latestPPCVersion = await _databaseManager.GetLatestPPCVersion(sourceApp, versionTag); OnProgress(AzureUtilsStage.Storage, $"Upgrading PPC version storage..."); @@ -189,11 +189,11 @@ namespace Tango.AzureUtils.Storage OnCompleted("Latest Machine Studio storage blobs removed."); } - public async Task DowngradePPCStorage(IWebAppBase app) + public async Task DowngradePPCStorage(IWebAppBase app, String versionTag) { OnProgress(AzureUtilsStage.Storage, $"Retrieving settings..."); - var latestPPCVersion = await _databaseManager.GetLatestPPCVersion(app); + var latestPPCVersion = await _databaseManager.GetLatestPPCVersion(app, versionTag); var settings = await app.GetMachineServiceSettingsAsync(); await RemoveBlob(settings.TANGO_VERSIONS_CONTAINER, latestPPCVersion.BlobName); @@ -202,15 +202,15 @@ namespace Tango.AzureUtils.Storage OnCompleted("Latest PPC storage blobs removed."); } - public async Task ValidatePPCStorageUpgrade(IWebAppBase sourceApp, IWebAppBase targetApp) + public async Task ValidatePPCStorageUpgrade(IWebAppBase sourceApp, IWebAppBase targetApp, String versionTag) { OnProgress(AzureUtilsStage.Validating, "Validating PPC storage upgrade..."); var sourceSettings = await sourceApp.GetMachineServiceSettingsAsync(); var targetSettings = await targetApp.GetMachineServiceSettingsAsync(); - var latestSourcePPCVersion = await _databaseManager.GetLatestPPCVersion(sourceApp); - var latestTargetPPCVersion = await _databaseManager.GetLatestPPCVersion(targetApp); + var latestSourcePPCVersion = await _databaseManager.GetLatestPPCVersion(sourceApp, versionTag); + var latestTargetPPCVersion = await _databaseManager.GetLatestPPCVersion(targetApp, versionTag); var targetAccount = CloudStorageAccount.Parse(targetSettings.STORAGE_ACCOUNT); var targetClient = targetAccount.CreateCloudBlobClient(); @@ -292,12 +292,12 @@ namespace Tango.AzureUtils.Storage } } - public async Task DownloadLatestPPCVersion(IWebAppBase app, String filePath) + public async Task DownloadLatestPPCVersion(IWebAppBase app, String filePath, String versionTag) { OnProgress(AzureUtilsStage.Storage, $"Retrieving source and target settings..."); var settings = await app.GetMachineServiceSettingsAsync(); - var ppcVersion = await _databaseManager.GetLatestPPCVersion(app); + var ppcVersion = await _databaseManager.GetLatestPPCVersion(app, versionTag); OnProgress(AzureUtilsStage.Storage, $"Downloading PPC version '{ppcVersion.Version}'..."); @@ -312,21 +312,21 @@ namespace Tango.AzureUtils.Storage using (FileStreamWrapper st = new FileStreamWrapper(filePath, FileMode.Create, (progress) => { - OnProgress(AzureUtilsStage.Storage, $"Downloading PPC version '{ppcVersion.Version}'...", progress, length, false); + OnProgress(AzureUtilsStage.Storage, $"Downloading PPC version '{ppcVersion.VersionAndTag}'...", progress, length, false); })) { await blob.DownloadToStreamAsync(st); } } - public async Task ReplaceLatestPPCVersion(IWebAppBase app, String filePath) + public async Task ReplaceLatestPPCVersion(IWebAppBase app, String filePath, String versionTag) { OnProgress(AzureUtilsStage.Storage, $"Retrieving source and target settings..."); var settings = await app.GetMachineServiceSettingsAsync(); - var ppcVersion = await _databaseManager.GetLatestPPCVersion(app); + var ppcVersion = await _databaseManager.GetLatestPPCVersion(app, versionTag); - OnProgress(AzureUtilsStage.Storage, $"Uploading PPC version '{ppcVersion.Version}'..."); + OnProgress(AzureUtilsStage.Storage, $"Uploading PPC version '{ppcVersion.VersionAndTag}'..."); var account = CloudStorageAccount.Parse(settings.STORAGE_ACCOUNT); var client = account.CreateCloudBlobClient(); |
