[WIP] Publish artifacts to new structure in Azure storage. (dotnet/core-setup#2385)
authorEric Mellino <erme@microsoft.com>
Tue, 16 May 2017 01:53:52 +0000 (18:53 -0700)
committerGitHub <noreply@github.com>
Tue, 16 May 2017 01:53:52 +0000 (18:53 -0700)
* Publish artifacts to new structure in Azure storage.

* PR feedback

* Pass ProductVersion through to FinalizeBuild task

* Update README.md with new blog storage locations.

Commit migrated from https://github.com/dotnet/core-setup/commit/4e9014930945b85884bf0bbec277c04ab83f157c

src/installer/publish/dir.props
src/installer/publish/dir.targets
src/installer/publish/publish.proj
tools-local/tasks/FinalizeBuild.cs

index 46cd145..a54287c 100644 (file)
@@ -7,8 +7,8 @@
     <ChecksumContainerName Condition="'$(ChecksumContainerName)' == ''">dotnet</ChecksumContainerName>
     <BaseUrl Condition="'$(BaseUrl)' == ''">https://dotnetcli.blob.core.windows.net/</BaseUrl>
     <NuGetPushTimeoutSeconds Condition="'$(NuGetPushTimeoutSeconds)' == ''">3600</NuGetPushTimeoutSeconds>
-    <BinariesRelativePath>$(Channel)/Binaries/$(SharedFrameworkNugetVersion)</BinariesRelativePath>
-    <InstallersRelativePath>$(Channel)/Installers/$(SharedFrameworkNugetVersion)</InstallersRelativePath>
+    <BinariesRelativePath>Runtime/$(SharedFrameworkNugetVersion)</BinariesRelativePath>
+    <InstallersRelativePath>Runtime/$(SharedFrameworkNugetVersion)</InstallersRelativePath>
     <ChecksumsRelativePath>Runtime/$(ProductVersion)</ChecksumsRelativePath>
     <ChecksumExtension>.sha512</ChecksumExtension>
   </PropertyGroup>
   </ItemGroup>
 
   <ItemGroup>
-    <PublishRid Include="ubuntu.14.04-x64">
-      <VersionFileName>ubuntu.x64</VersionFileName>
-    </PublishRid>
-    <PublishRid Include="ubuntu.16.04-x64">
-      <VersionFileName>ubuntu.16.04.x64</VersionFileName>
-    </PublishRid>
-    <PublishRid Include="ubuntu.16.10-x64">
-      <VersionFileName>ubuntu.16.10.x64</VersionFileName>
-    </PublishRid>
-    <PublishRid Include="debian.8-x64">
-      <VersionFileName>debian.x64</VersionFileName>
-    </PublishRid>
-    <PublishRid Include="linux-x64">
-      <VersionFileName>linux.x64</VersionFileName>
-    </PublishRid>
-    <PublishRid Include="win-x86">
-      <VersionFileName>win.x86</VersionFileName>
-    </PublishRid>
-    <PublishRid Include="win-x64">
-      <VersionFileName>win.x64</VersionFileName>
-    </PublishRid>
-    <PublishRid Include="osx-x64">
-      <VersionFileName>osx.x64</VersionFileName>
-    </PublishRid>
-    <PublishRid Include="win-arm">
-      <VersionFileName>win.arm</VersionFileName>
-    </PublishRid>
-    <PublishRid Include="win-arm64">
-      <VersionFileName>win.arm64</VersionFileName>
-    </PublishRid>
-    <PublishRid Include="linux-arm">
-      <VersionFileName>linux.arm</VersionFileName>
-    </PublishRid>
+    <PublishRid Include="ubuntu.14.04-x64" />
+    <PublishRid Include="ubuntu.16.04-x64" />
+    <PublishRid Include="ubuntu.16.10-x64" />
+    <PublishRid Include="debian.8-x64" />
+    <PublishRid Include="linux-x64" />
+    <PublishRid Include="win-x86" />
+    <PublishRid Include="win-x64" />
+    <PublishRid Include="osx-x64" />
+    <PublishRid Include="win-arm" />
+    <PublishRid Include="win-arm64" />
+    <PublishRid Include="linux-arm" />
   </ItemGroup>
 </Project>
index 0977af8..a6c5543 100644 (file)
@@ -96,7 +96,7 @@
     <GetAzureBlobList AccountName="$(AzureAccountName)"
                       AccountKey="$(AzureAccessToken)"
                       ContainerName="$(ContainerName)"
-                      FilterBlobNames="$(Channel)/Binaries/$(SharedFrameworkNugetVersion)/">
+                      FilterBlobNames="Runtime/$(SharedFrameworkNugetVersion)/">
       <Output TaskParameter="BlobNames" ItemName="_BlobNames" />
     </GetAzureBlobList>
     <ItemGroup>
                          Exclude="@(_FoundBlobNames)" />
     </ItemGroup>
     <Error Text="Missing publish output from all legs of the build. Missing blobs are '@(_MissingBlobNames)'"
-           Importance="High"
            Condition="'@(_MissingBlobNames)' != ''" />
   </Target>
 
index 7668658..d32b2db 100644 (file)
     <FinalizeBuild AccountName="$(AzureAccountName)"
                    AccountKey="$(AzureAccessToken)"
                    ContainerName="$(ContainerName)"
-                   SemaphoreBlob="$(Channel)/Binaries/sharedFxPublishSemaphore"
+                   SemaphoreBlob="Runtime/$(Channel)/sharedFxPublishSemaphore"
                    Channel="$(Channel)"
                    Version="$(SharedFrameworkNugetVersion)"
                    SharedFrameworkNugetVersion="$(SharedFrameworkNugetVersion)"
                    SharedHostNuGetVersion="$(HostVersion)"
-                   PublishRids="@(PublishRid)"
+                   ProductVersion="$(ProductVersion)"
                    CommitHash="$(LatestCommit)"
-                   FinalizeContainer="$(Channel)/Binaries/$(SharedFrameworkNugetVersion)"
+                   FinalizeContainer="Runtime/$(SharedFrameworkNugetVersion)"
                    ForcePublish="true"                  
                    Condition="'@(_MissingBlobNames)' == ''" />
   </Target>
     <GetAzureBlobList AccountName="$(AzureAccountName)"
                       AccountKey="$(AzureAccessToken)"
                       ContainerName="$(ContainerName)"
-                      FilterblobNames="$(Channel)/Binaries/$(SharedFrameworkNugetVersion)">
+                      FilterblobNames="Runtime/$(SharedFrameworkNugetVersion)">
       <Output TaskParameter="BlobNames" ItemName="_BlobList" />
     </GetAzureBlobList>
     <ItemGroup>
index e57aa5a..63db705 100644 (file)
@@ -35,9 +35,9 @@ namespace Microsoft.DotNet.Build.Tasks
         [Required]
         public string SharedHostNugetVersion { get; set; }
         [Required]
-        public string Version { get; set; }
+        public string ProductVersion { get; set; }
         [Required]
-        public ITaskItem [] PublishRids { get; set; }
+        public string Version { get; set; }
         [Required]
         public string CommitHash { get; set; }
         public bool ForcePublish { get; set; }
@@ -92,20 +92,11 @@ namespace Microsoft.DotNet.Build.Tasks
 
                 try
                 {
-                    CopyBlobs($"{Channel}/Binaries/{SharedFrameworkNugetVersion}", $"{Channel}/Binaries/Latest/");
-
-                    CopyBlobs($"{Channel}/Installers/{SharedFrameworkNugetVersion}", $"{Channel}/Installers/Latest/");
-
-                    CopyBlobs($"{Channel}/Installers/{SharedHostNugetVersion}", $"{Channel}/Installers/Latest/");
-
-                    // Generate the Sharedfx Version text files
-                    List<string> versionFiles = PublishRids.Select(p => $"{p.GetMetadata("VersionFileName")}.version").ToList();
+                    CopyBlobs($"Runtime/{ProductVersion}", $"Runtime/{Channel}/");
 
+                    // Generate the latest version text file
                     string sfxVersion = GetSharedFrameworkVersionFileContent();
-                    foreach(string version in versionFiles)
-                    {
-                        PublishStringToBlob(ContainerName, $"{Channel}/dnvm/latest.sharedfx.{version}", sfxVersion, "text/plain");
-                    }
+                    PublishStringToBlob(ContainerName, $"Runtime/{Channel}/latest.version", sfxVersion, "text/plain");
                 }
                 finally
                 {