dotnet-sdk DEB package consume store by dependency

Instead of Packing along.
Edit Debian config, add download store deb package as part of the packing process as well as test.
This commit is contained in:
William Li 2017-07-13 12:07:51 -07:00
parent dcce9ce34c
commit b9c5e2ec57
4 changed files with 27 additions and 10 deletions

View file

@ -16,7 +16,8 @@
<Target Name="BuildSdkDeb"
Condition=" '$(IsDebianBaseDistro)' == 'True' AND '$(DebuildPresent)' == 'true' "
DependsOnTargets="PrepareDotnetDebDirectories;
PrepareDotnetDebTool;"
PrepareDotnetDebTool;
DownloadAspNetCoreRuntimeDebInstaller;"
Inputs="@(CLISdkFiles)"
Outputs="$(SdkInstallerFile)" >
@ -24,6 +25,7 @@
<Exec Command="sudo dpkg -i $(DownloadedSharedHostInstallerFile)" />
<Exec Command="sudo dpkg -i $(DownloadedHostFxrInstallerFile)" />
<Exec Command="sudo dpkg -i $(DownloadedSharedFrameworkInstallerFile)" />
<Exec Command="sudo dpkg -i $(DownloadedSharedAspNetCoreRuntime)" />
<!-- Create layout: Binaries -->
<Copy
@ -33,14 +35,6 @@
SkipUnchangedFiles="False"
UseHardlinksIfPossible="False" />
<!-- Create layout: Aspnet runtime -->
<Copy
DestinationFiles="@(AspNetRuntimeFilesInput ->'$(LayoutPackageRootDir)/%(RecursiveDir)%(Filename)%(Extension)')"
SourceFiles="@(AspNetRuntimeFilesInput)"
OverwriteReadOnlyFiles="True"
SkipUnchangedFiles="False"
UseHardlinksIfPossible="False" />
<!-- Create layout: Man Pages -->
<Copy
DestinationFiles="@(SdkDebManPageFiles->'$(LayoutDocsDir)/%(RecursiveDir)%(Filename)-$(SdkVersion)%(Extension)')"
@ -91,6 +85,7 @@
<!-- Remove Shared Framework and Debian Packages -->
<Exec Command="sudo dpkg -r $(SdkDebianPackageName)" />
<Exec Command="sudo dpkg -r $(AspNetCoreRuntimePackageName)" />
<Exec Command="sudo dpkg -r $(SharedFxDebianPackageName)" />
<Exec Command="sudo dpkg -r $(HostFxrDebianPackageName)" />
@ -110,6 +105,7 @@
<Exec Command="sudo dpkg -i $(DownloadedSharedHostInstallerFile)" />
<Exec Command="sudo dpkg -i $(DownloadedHostFxrInstallerFile)" />
<Exec Command="sudo dpkg -i $(DownloadedSharedFrameworkInstallerFile)" />
<Exec Command="sudo dpkg -i $(DownloadedSharedAspNetCoreRuntime)" />
<Exec Command="sudo dpkg -i $(SdkInstallerFile)" />
@ -123,6 +119,7 @@
<!-- Clean up Packages -->
<Exec Command="sudo dpkg -r $(SdkDebianPackageName)" />
<Exec Command="sudo dpkg -r $(AspNetCoreRuntimePackageName)" />
<Exec Command="sudo dpkg -r $(SharedFxDebianPackageName)" />
<Exec Command="sudo dpkg -r $(HostFxrDebianPackageName)" />

View file

@ -35,6 +35,10 @@
<HostFxrDebianPackageName>dotnet-hostfxr-$(HostFxrDebianPackageVersion)</HostFxrDebianPackageName>
<HostFxrDebianPackageName>$(HostFxrDebianPackageName.ToLower())</HostFxrDebianPackageName>
<HostDebianPackageName>dotnet-host</HostDebianPackageName>
<AspNetCoreRuntimePackageName>$(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreCoherenceTimestamp)</AspNetCoreRuntimePackageName>
<HostRidInAspNetCoreRuntimeDebInstallerFileName>$(HostRid)</HostRidInAspNetCoreRuntimeDebInstallerFileName>
<HostRidInAspNetCoreRuntimeDebInstallerFileName Condition=" '$(HostRid)' == 'debian.8-x64' ">debian-x64</HostRidInAspNetCoreRuntimeDebInstallerFileName>
<AspNetCoreRuntimeDebInstallerFileName>$(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreCoherenceTimestamp)-$(HostRidInAspNetCoreRuntimeDebInstallerFileName).deb</AspNetCoreRuntimeDebInstallerFileName>
</PropertyGroup>
<!-- Inputs -->
@ -83,6 +87,9 @@
<DebianConfigTokenValues Include="%SHARED_FRAMEWORK_DEBIAN_PACKAGE_NAME%">
<ReplacementString>$(SharedFxDebianPackageName)</ReplacementString>
</DebianConfigTokenValues>
<DebianConfigTokenValues Include="%ASPNETCOREPACKAGESTORE_DEBIAN_PACKAGE_NAME%">
<ReplacementString>$(AspNetCoreRuntimePackageName)</ReplacementString>
</DebianConfigTokenValues>
<DebianConfigTokenValues Include="%SHARED_FRAMEWORK_DEBIAN_PACKAGE_ADDITIONAL_DEPENDENCY%"
Condition="'$(IncludeAdditionalSharedFrameworks)' == 'true'">
<ReplacementString>,
@ -107,4 +114,14 @@
<GeneratedInstallers Include="$(SdkInstallerFile)" />
</ItemGroup>
</Target>
<Target Name="DownloadAspNetCoreRuntimeDebInstaller"
DependsOnTargets="SetupDebProps">
<PropertyGroup>
<DownloadedSharedAspNetCoreRuntime>$(PackagesDirectory)/$(AspNetCoreRuntimeDebInstallerFileName)</DownloadedSharedAspNetCoreRuntime>
</PropertyGroup>
<DownloadFile
Uri="$(AspNetCoreRuntimeInstallerBlobRootUrl)/$(AspNetCoreRuntimeDebInstallerFileName)"
DestinationPath="$(DownloadedSharedAspNetCoreRuntime)"/>
</Target>
</Project>

View file

@ -29,6 +29,7 @@
},
"debian_dependencies":{
"%SHARED_FRAMEWORK_DEBIAN_PACKAGE_NAME%" : {}%SHARED_FRAMEWORK_DEBIAN_PACKAGE_ADDITIONAL_DEPENDENCY%
"%SHARED_FRAMEWORK_DEBIAN_PACKAGE_NAME%" : {}%SHARED_FRAMEWORK_DEBIAN_PACKAGE_ADDITIONAL_DEPENDENCY%,
"%ASPNETCOREPACKAGESTORE_DEBIAN_PACKAGE_NAME%": {}
}
}

View file

@ -13,8 +13,10 @@ if [ $current_userid -ne 0 ]; then
fi
host_package_name="dotnet-host"
aspnetcore_package_store_package_name="^aspnetcore-store.*"
remove_all(){
apt-get purge -y $aspnetcore_package_store_package_name
apt-get purge -y $host_package_name
}