Example #1
0
        private static async Task <VersionCheck> CheckNewVersionAsync(DeployScript script)
        {
            Console.WriteLine("Checking for updated local version...");

            var localVersion = GetLocalVersion(script.VersionSourceFile);

            var uri  = new Uri(GetBlobNameFromFilename(script.InstallerExe, script.StorageAccount));
            var blob = new CloudBlockBlob(uri);

            try
            {
                var remoteVersion = (await blob.ExistsAsync()) ?
                                    Version.Parse(blob.Metadata[VersionCheck.VersionMetadata]) :
                                    Version.Parse("0.0.0.0");

                return(new VersionCheck()
                {
                    IsNew = (localVersion > remoteVersion),
                    Version = localVersion
                });
            }
            catch
            {
                return(new VersionCheck()
                {
                    IsNew = true,
                    Version = localVersion
                });
            }
        }
Example #2
0
        private static async Task UploadInstallerAsync(DeployScript script, VersionCheck check)
        {
            Console.WriteLine($"Uploading version {check.Version} installer...");
            var uri  = new Uri(GetBlobNameFromFilename(script.InstallerExe, script.StorageAccount));
            var blob = new CloudBlockBlob(uri, new StorageCredentials(script.StorageAccount.Name, script.StorageAccount.Key));
            await blob.UploadFromFileAsync(script.InstallerExe);

            blob.Metadata[VersionCheck.VersionMetadata] = check.Version.ToString();
            await blob.SetMetadataAsync();
        }
Example #3
0
 private static void BuildInstaller(DeployScript script, Version version)
 {
     throw new NotImplementedException();
 }