Merge pull request #7153 from wli3/dev/wul/deb-installer-store-dependency-finish

dotnet-sdk DEB and RPM package consume store by "dependency" field
This commit is contained in:
William Lee 2017-07-13 15:38:03 -07:00 committed by GitHub
commit 8a65dc1c92
9 changed files with 71 additions and 27 deletions

View file

@ -31,7 +31,7 @@
</PropertyGroup>
<PropertyGroup>
<AspNetCoreRuntimeInstallerBlobRootUrl>$(CoreSetupBlobRootUrl)aspnetcore/store/$(AspNetCoreRuntimeVersion)-$(AspNetCoreCoherenceTimestamp)</AspNetCoreRuntimeInstallerBlobRootUrl>
<AspNetCoreRuntimeInstallerBlobRootUrl>$(CoreSetupBlobRootUrl)aspnetcore/store/$(AspNetCoreRuntimeAzureblobStoresSubfolderName)</AspNetCoreRuntimeInstallerBlobRootUrl>
<AspNetCoreSharedRuntimeVersionFileName>runtime.version</AspNetCoreSharedRuntimeVersionFileName>
<AspNetCoreSharedRuntimeVersionFile Condition=" '$(AspNetCoreSharedRuntimeVersionFileName)' != '' ">$(PackagesDirectory)/$(AspNetCoreSharedRuntimeVersionFileName)</AspNetCoreSharedRuntimeVersionFile>
@ -40,8 +40,8 @@
<AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(HostOSName)' == 'osx' ">$(HostOSName)</AspNetCoreRuntimeInstallerArchiveFileNameOSToken>
<AspNetCoreRuntimeInstallerArchiveFileNameOSToken Condition=" '$(AspNetCoreRuntimeInstallerArchiveFileNameOSToken)' == '' ">linux</AspNetCoreRuntimeInstallerArchiveFileNameOSToken>
<AspNetCoreRuntimeStoreSuffix Condition="'$(AspNetCoreRuntimePackageFlavor)' != 'notimestamp'">-$(AspNetCoreCoherenceTimestamp)</AspNetCoreRuntimeStoreSuffix>
<AspNetCoreRuntimeInstallerArchiveSuffix Condition="'$(AspNetCoreRuntimeStoreSuffix)' != ''">-$(AspNetCoherenceLabel)$(AspNetCoreRuntimeStoreSuffix)</AspNetCoreRuntimeInstallerArchiveSuffix>
<AspNetCoreRuntimeStoreSuffix Condition="'$(AspNetCoreRuntimePackageFlavor)' != 'notimestamp'">-$(AspNetCoreRuntimePackageTimestamp)</AspNetCoreRuntimeStoreSuffix>
<AspNetCoreRuntimeInstallerArchiveSuffix Condition="'$(AspNetCoreRuntimeStoreSuffix)' != ''">-$(AspNetCoreRelease)$(AspNetCoreRuntimeStoreSuffix)</AspNetCoreRuntimeInstallerArchiveSuffix>
<AspNetCoreRuntimeInstallerArchiveFileName>Build.RS.$(AspNetCoreRuntimeInstallerArchiveFileNameOSToken)$(AspNetCoreRuntimeInstallerArchiveSuffix)$(ArchiveExtension)</AspNetCoreRuntimeInstallerArchiveFileName>
<AspNetCoreRuntimeInstallerArchiveFile>$(PackagesDirectory)/$(AspNetCoreRuntimeInstallerArchiveFileName)</AspNetCoreRuntimeInstallerArchiveFile>

View file

@ -35,10 +35,15 @@
<!-- This should either be timestamped or notimestamp as appropriate -->
<AspNetCoreRuntimePackageFlavor>timestamped</AspNetCoreRuntimePackageFlavor>
<AspNetCoreRuntimeVersion>2.0.0</AspNetCoreRuntimeVersion>
<AspNetCoherenceLabel>rtm</AspNetCoherenceLabel>
<AspNetCoreCoherenceTimestamp>26239</AspNetCoreCoherenceTimestamp>
<!--BranchName and AspNetCoreVersion will not always be the same-->
<AspNetCoreBranchName>2.0.0</AspNetCoreBranchName>
<AspNetCoreRelease>rtm</AspNetCoreRelease>
<AspNetCoreVersion>2.0.0</AspNetCoreVersion>
<AspNetCoreRuntimePackageTimestamp>26239</AspNetCoreRuntimePackageTimestamp>
<AspNetCoreRuntimePackageBrandName>aspnetcore-store</AspNetCoreRuntimePackageBrandName>
<AspNetCoreVersionAndRelease>$(AspNetCoreVersion)-$(AspNetCoreRelease)</AspNetCoreVersionAndRelease>
<AspNetCoreRuntimeAzureblobStoresSubfolderName>$(AspNetCoreBranchName)-$(AspNetCoreRuntimePackageTimestamp)</AspNetCoreRuntimeAzureblobStoresSubfolderName>
</PropertyGroup>
<!-- infrastructure and test only dependencies -->

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)-$(AspNetCoreRuntimePackageTimestamp)</AspNetCoreRuntimePackageName>
<HostRidInAspNetCoreRuntimeDebInstallerFileName>$(HostRid)</HostRidInAspNetCoreRuntimeDebInstallerFileName>
<HostRidInAspNetCoreRuntimeDebInstallerFileName Condition=" '$(HostRid)' == 'debian.8-x64' ">debian-x64</HostRidInAspNetCoreRuntimeDebInstallerFileName>
<AspNetCoreRuntimeDebInstallerFileName>$(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreRuntimePackageTimestamp)-$(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

@ -50,6 +50,11 @@
<HostFxrRpmPackageName>dotnet-hostfxr-$(HostFxrRpmPackageVersion)</HostFxrRpmPackageName>
<HostFxrRpmPackageName>$(HostFxrRpmPackageName.ToLower())</HostFxrRpmPackageName>
<HostRpmPackageName>dotnet-host</HostRpmPackageName>
<HostRidInAspNetCoreRuntimeRpmInstallerFileName>$(HostRid)</HostRidInAspNetCoreRuntimeRpmInstallerFileName>
<HostRidInAspNetCoreRuntimeRpmInstallerFileName Condition=" '$(HostRid)' == 'rhel.7-x64' ">rhel-x64</HostRidInAspNetCoreRuntimeRpmInstallerFileName>
<AspNetCoreRuntimePackageName>$(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreRuntimePackageTimestamp)</AspNetCoreRuntimePackageName>
<AspNetCoreRuntimePackageVersion>$(AspNetCoreVersion)-$(AspNetCoreRelease)-$(AspNetCoreRuntimePackageTimestamp)</AspNetCoreRuntimePackageVersion>
<AspNetCoreRuntimeRpmInstallerFileName>$(AspNetCoreRuntimePackageBrandName)-$(AspNetCoreVersionAndRelease)-$(AspNetCoreRuntimePackageTimestamp)-$(HostRidInAspNetCoreRuntimeRpmInstallerFileName).rpm</AspNetCoreRuntimeRpmInstallerFileName>
</PropertyGroup>
<PropertyGroup>
@ -74,7 +79,6 @@
<SDKManpages Include="$(ManPagesDir)/**/*"/>
<SDKTemplatesFiles Include="$(TemplatesDir)/**/*"/>
<SDKScriptsFiles Include="$(ScriptsDir)/**/*"/>
<AspNetRuntimeFilesInput Include="$(AspNetRuntimePackageStorePublishDirectory)/**/*" />
</ItemGroup>
<Copy SourceFiles="@(SDKFiles)"
@ -101,17 +105,17 @@
SkipUnchangedFiles="False"
UseHardlinksIfPossible="False"/>
<Copy SourceFiles="@(AspNetRuntimeFilesInput)"
DestinationFiles="@(AspNetRuntimeFilesInput ->'$(RpmLayoutPackageRoot)/%(RecursiveDir)%(Filename)%(Extension)')"
OverwriteReadOnlyFiles="True"
SkipUnchangedFiles="False"
UseHardlinksIfPossible="False"/>
<!-- Replace config json variables -->
<ItemGroup>
<SDKTokenValue Include="%SHARED_HOST_RPM_VERSION%">
<ReplacementString>$(SharedFrameworkVersion)</ReplacementString>
</SDKTokenValue>
<SDKTokenValue Include="%ASPNETCOREPACKAGESTORE_RPM_PACKAGE_NAME%">
<ReplacementString>$(AspNetCoreRuntimePackageName)</ReplacementString>
</SDKTokenValue>
<SDKTokenValue Include="%ASPNETCOREPACKAGESTORE_RPM_PACKAGE_VERSION%">
<ReplacementString>$(AspNetCoreRuntimePackageVersion)</ReplacementString>
</SDKTokenValue>
<SDKTokenValue Include="%SHARED_HOST_RPM_NAME%">
<ReplacementString>$(SharedFxRpmPackageName)</ReplacementString>
</SDKTokenValue>
@ -162,6 +166,16 @@
</Target>
<Target Name="DownloadAspNetCoreRuntimeRpmInstaller"
DependsOnTargets="SetupDebProps">
<PropertyGroup>
<DownloadedSharedAspNetCoreRuntime>$(PackagesDirectory)/$(AspNetCoreRuntimeRpmInstallerFileName)</DownloadedSharedAspNetCoreRuntime>
</PropertyGroup>
<DownloadFile
Uri="$(AspNetCoreRuntimeInstallerBlobRootUrl)/$(AspNetCoreRuntimeRpmInstallerFileName)"
DestinationPath="$(DownloadedSharedAspNetCoreRuntime)"/>
</Target>
<Target Name="TestFPMTool">
<!-- run FPM -->
@ -182,11 +196,12 @@
</Target>
<Target Name="TestSdkRpm"
DependsOnTargets="RestoreTests"
DependsOnTargets="RestoreTests;DownloadAspNetCoreRuntimeRpmInstaller"
Condition=" '$(IsRPMBasedDistro)' == 'True' and '$(FPMPresent)' == 'True' "
Inputs="$(DownloadedSharedHostInstallerFile);
$(DownloadedHostFxrInstallerFile);
$(DownloadedSharedFrameworkInstallerFile);
$(DownloadedSharedAspNetCoreRuntime);
$(RpmTestResultsXmlFile);"
Outputs="$(RpmTestResultsXmlFile)" >
@ -194,6 +209,7 @@
<Exec Command="sudo yum -y install $(DownloadedSharedHostInstallerFile)" />
<Exec Command="sudo yum -y install $(DownloadedHostFxrInstallerFile)" />
<Exec Command="sudo yum -y install $(DownloadedSharedFrameworkInstallerFile)" />
<Exec Command="sudo yum -y install $(DownloadedSharedAspNetCoreRuntime)" />
<Exec Command="sudo yum -y install $(SdkInstallerFile)" />
@ -207,6 +223,8 @@
<!-- Clean up Packages -->
<Exec Command="sudo yum remove -y $(SdkRpmPackageName)" />
<Exec Command="sudo yum remove -y $(AspNetCoreRuntimePackageName)" />
<Exec Command="sudo yum remove -y $(SharedFxRpmPackageName)" />
<Exec Command="sudo yum remove -y $(HostFxrRpmPackageName)" />
<Exec Command="sudo yum remove -y $(HostRpmPackageName)" />

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

@ -25,14 +25,16 @@
{
"package_name": "%SHARED_HOST_RPM_NAME%",
"package_version": "%SHARED_HOST_RPM_VERSION%"
},
{
"package_name": "%ASPNETCOREPACKAGESTORE_RPM_PACKAGE_NAME%",
"package_version": "%ASPNETCOREPACKAGESTORE_RPM_PACKAGE_VERSION%"
}
],
"directories": [
"/usr/share/dotnet/sdk",
"/usr/share/dotnet/store",
"/usr/share/dotnet/additionalDeps",
"/usr/share/doc/%SDK_RPM_PACKAGE_NAME%"
],
"after_install_source": "scripts/after_install_host.sh",
"after_remove_source": "scripts/after_remove_host.sh"
}
}

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
}

View file

@ -13,9 +13,11 @@ if [ $current_userid -ne 0 ]; then
fi
host_package_name="dotnet-host"
aspnetcore_package_store_package_name="aspnetcore-store*"
remove_all(){
yum remove -y $host_package_name
yum remove -y $aspnetcore_package_store_package_name
}
is_dotnet_host_installed(){