From c473800042e2ea611124fe7c35dec966b56b120b Mon Sep 17 00:00:00 2001 From: = Date: Thu, 20 Jul 2017 14:43:58 -0700 Subject: [PATCH] Installer generation updates Produce dotnet hosting bundle installers .deb, .rpm, .tar.gz test generated installers after building --- build/repo.targets | 639 ++++++++++++++---- tools/RestoreRuntimeStore/NuGet.config | 7 - .../RestoreRuntimeStore.csproj | 13 - tools/docker/{debian => debian.8}/Dockerfile | 0 tools/docker/{rhel => rhel.7}/Dockerfile | 0 tools/{ => packaging}/changelog | 0 tools/packaging/hosting_debian_config.json | 35 + .../store_debian_config.json} | 6 +- .../GetSharedFrameworkVersion.ps1 | 0 .../GetSharedFrameworkVersion.sh | 0 .../InstallSharedFrameworkx86.ps1 | 0 tools/scripts/TestInstallers.sh | 77 +++ tools/{ => scripts}/zip2tgz.sh | 0 13 files changed, 622 insertions(+), 155 deletions(-) delete mode 100644 tools/RestoreRuntimeStore/NuGet.config delete mode 100644 tools/RestoreRuntimeStore/RestoreRuntimeStore.csproj rename tools/docker/{debian => debian.8}/Dockerfile (100%) rename tools/docker/{rhel => rhel.7}/Dockerfile (100%) rename tools/{ => packaging}/changelog (100%) create mode 100644 tools/packaging/hosting_debian_config.json rename tools/{debian_config.json => packaging/store_debian_config.json} (89%) rename tools/{ => scripts}/GetSharedFrameworkVersion.ps1 (100%) rename tools/{ => scripts}/GetSharedFrameworkVersion.sh (100%) rename tools/{ => scripts}/InstallSharedFrameworkx86.ps1 (100%) create mode 100755 tools/scripts/TestInstallers.sh rename tools/{ => scripts}/zip2tgz.sh (100%) diff --git a/build/repo.targets b/build/repo.targets index d9f6d219b1..18e4610c8b 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -28,10 +28,13 @@ aspnetcore-store-$(TimestampVersion) aspnetcore-store-$(NoTimestampVersion) + dotnet-hosting-$(TimestampVersion) + dotnet-hosting-$(NoTimestampVersion) $(RepositoryRoot).rw\ $(RepositoryRoot).ro\ $(RepositoryRoot)artifacts\ + $(ArtifactsDir)dotnetInstallers\ $(ArtifactsDir)zip\ $(ArtifactsDir)deps\ $(ArtifactsZipDir)t\ @@ -40,31 +43,34 @@ $(ArtifactsZipDir)sn\ $(ArtifactsDir)installers\ $(ArtifactsDir)rsArchive\ - $(ArtifactsDir)itLayout\ + $(ArtifactsDir)StoreTimestampLayout\ $(RuntimeStoreInstallerLayoutTimestampDirectory)package_root\ - $(ArtifactsDir)inLayout\ + $(ArtifactsDir)StoreTimestampOutput\ + $(ArtifactsDir)StoreNoTimestampLayout\ $(RuntimeStoreInstallerLayoutNoTimestampDirectory)package_root\ - $(ArtifactsDir)itOutput\ - $(ArtifactsDir)inOutput\ + $(ArtifactsDir)StoreNoTimestampOutput\ + $(ArtifactsDir)HostingTimestampLayout\ + $(HostingBundleInstallerLayoutTimestampDirectory)package_root\ + $(ArtifactsDir)HostingTimestampOutput\ + $(ArtifactsDir)HostingNoTimestampLayout\ + $(HostingBundleInstallerLayoutNoTimestampDirectory)package_root\ + $(ArtifactsDir)HostingNoTimestampOutput\ $(ArtifactsDir)temp\ $(RepositoryRoot)tools\ + $(ToolsDir)packaging\ + $(ToolsDir)scripts\ $(ToolsDir)docker\ $(RepositoryRoot).deps\build\ $(ToolsDir)Build.RuntimeStore.References\ $(RuntimeStoreReferenceDirectory)bin\Release\ - $(ToolsDir)debian_config.json - $(ToolsDir)changelog + $(PackagingDir)store_debian_config.json + $(PackagingDir)hosting_debian_config.json + $(PackagingDir)changelog $(ToolsDir)dotnet-deb-tool-consumer\ - $(ToolsDir)RestoreRuntimeStore\ $(RepositoryRoot).build\ $(BuildDirectory)temp\ $(BuildDirectory)dotnet\ /opt/code/ - - - $(PrepareDependsOn); - UpdateNuGetConfig - @@ -197,7 +203,7 @@ - + @@ -205,10 +211,10 @@ - + - + @@ -228,7 +234,7 @@ - + $(BuildTempDirectory)shared\Microsoft.NETCore.App\$(SharedFrameworkVersion) @@ -331,9 +337,9 @@ - + - + @@ -345,27 +351,63 @@ + + + + + + + + + - $(RUNTIMESTORE_SIGNED_ARTIFACTS_PATH) - $(RuntimeStoreArchiveDirectory) + http://dotnetcli.azureedge.net/dotnet/Runtime/$(SharedFrameworkVersion)/dotnet-host-$(SharedFrameworkVersion) + http://dotnetcli.azureedge.net/dotnet/Runtime/$(SharedFrameworkVersion)/dotnet-hostfxr-$(SharedFrameworkVersion) + http://dotnetcli.azureedge.net/dotnet/Runtime/$(SharedFrameworkVersion)/dotnet-runtime-$(SharedFrameworkVersion) + http://dotnetcli.azureedge.net/dotnet/Runtime/$(SharedFrameworkVersion)/dotnet-runtime-$(SharedFrameworkVersion)-linux-x64.tar.gz - - + - - + + + + + + + + + + + + + + + + + + $(HostingBundleTimestampInstallerPackageName)-linux-$(PACKAGE_CACHE_PLATFORM).tar.gz + $(HostingBundleNoTimestampInstallerPackageName)-linux-$(PACKAGE_CACHE_PLATFORM).tar.gz + + + + + + + + + + + - - + + - - @@ -381,98 +423,208 @@ OverwriteReadOnlyFiles="True" SkipUnchangedFiles="False" UseHardlinksIfPossible="False" /> + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @(_InstallerSummary) - @(_InstallerDescription) - @(_InstallerLicense) - @(_InstallerPackageRevision) - @(_InstallerHomepage) - @(_InstallerMaintainerName) - @(_InstallerMaintainerEmail) - @(_InstallerChangelogMessage) + @(_StoreInstallerSummary) + @(_StoreInstallerDescription) + @(_StoreInstallerLicense) + @(_StoreInstallerPackageRevision) + @(_StoreInstallerHomepage) + @(_StoreInstallerMaintainerName) + @(_StoreInstallerMaintainerEmail) + @(_StoreInstallerChangelogMessage) + @(_HostingInstallerSummary) + @(_HostingInstallerDescription) + @(_HostingInstallerLicense) + @(_HostingInstallerPackageRevision) + @(_HostingInstallerHomepage) + @(_HostingInstallerMaintainerName) + @(_HostingInstallerMaintainerEmail) + @(_HostingInstallerChangelogMessage) + /opt/rh/rh-dotnet20/root/usr/lib64/dotnet/ + @(RHStoreDirectories->' --directories "%(FullPath)"', ' ') + /usr/share/dotnet/ + @(GeneralStoreDirectories->' --directories "%(FullPath)"', ' ') + + + Targets="BuildStoreAndHostingRPM" + Properties="DockerImage=rhel.7; + InstallerPlatform=rh.rhel.7; + InstallerInstallRoot=$(RHInstallerInstallRoot); + BuildNumber=$(BuildNumber); + SharedFrameworkVersion=$(SharedFrameworkVersion); + StoreDirectoriesArguments=$(RHStoreDirectoriesArguments); + StoreInstallerSummary=$(StoreInstallerSummary); + StoreInstallerDescription=$(StoreInstallerDescription); + StoreInstallerLicense=$(StoreInstallerLicense); + StoreInstallerPackageRevision=$(StoreInstallerPackageRevision); + StoreInstallerHomepage=$(StoreInstallerHomepage); + StoreInstallerMaintainerName=$(StoreInstallerMaintainerName); + StoreInstallerMaintainerEmail=$(StoreInstallerMaintainerEmail); + HostingInstallerSummary=$(HostingInstallerSummary); + HostingInstallerDescription=$(HostingInstallerDescription); + HostingInstallerLicense=$(HostingInstallerLicense); + HostingInstallerPackageRevision=$(HostingInstallerPackageRevision); + HostingInstallerHomepage=$(HostingInstallerHomepage); + HostingInstallerMaintainerName=$(HostingInstallerMaintainerName); + HostingInstallerMaintainerEmail=$(HostingInstallerMaintainerEmail); + SkipInstallerTests=true" /> + - - - - - - + $(RuntimeStoreTimestampInstallerPackageName)-$(InstallerPlatform)-$(PACKAGE_CACHE_PLATFORM).rpm $(RuntimeStoreNoTimestampInstallerPackageName)-$(InstallerPlatform)-$(PACKAGE_CACHE_PLATFORM).rpm - @(RPMDirectories->' --directories "%(FullPath)"', ' ') - $(InstallerMaintainerName) <$(InstallerMaintainerEmail)> + $(HostingBundleTimestampInstallerPackageName)-$(InstallerPlatform)-$(PACKAGE_CACHE_PLATFORM).rpm + $(HostingBundleNoTimestampInstallerPackageName)-$(InstallerPlatform)-$(PACKAGE_CACHE_PLATFORM).rpm + $(StoreInstallerMaintainerName) <$(StoreInstallerMaintainerEmail)> + $(HostingInstallerMaintainerName) <$(HostingInstallerMaintainerEmail)> .NET Foundation - /opt/rh/rh-dotnet20/root/usr/lib64/dotnet - - + + - + + -p $(DockerRootDirectory)artifacts/StoreTimestampOutput/$(RuntimeStoreTimestampRPMFileName) + --license "$(StoreInstallerLicense)" + --iteration $(StoreInstallerPackageRevision) + --url "$(StoreInstallerHomepage)" + $(DockerRootDirectory)artifacts/StoreTimestampLayout/package_root/="$(InstallerInstallRoot)"" /> + -p $(DockerRootDirectory)artifacts/StoreNoTimestampOutput/$(RuntimeStoreNoTimestampRPMFileName) + --license "$(StoreInstallerLicense)" + --iteration $(StoreInstallerPackageRevision) + --url "$(StoreInstallerHomepage)" + $(DockerRootDirectory)artifacts/StoreNoTimestampLayout/package_root/="$(InstallerInstallRoot)"" /> - - + + + + $(TimestampVersion) + + + $(SharedFrameworkVersion) + + + $(NoTimestampVersion) + + + $(SharedFrameworkVersion) + + + + + @(HostingBundleTimestampDependencies->' -d "%(Identity) >= %(Version)"', ' ') + @(HostingBundleNoTimestampDependencies->' -d "%(Identity) >= %(Version)"', ' ') + + + + - - + + + + - - + + + + + + + + + + + + + + + + + + - - + + - - + + - - - - + + + + + + + + + - - + $(RuntimeStoreTimestampInstallerPackageName)-$(InstallerPlatform)-$(PACKAGE_CACHE_PLATFORM).deb $(RuntimeStoreNoTimestampInstallerPackageName)-$(InstallerPlatform)-$(PACKAGE_CACHE_PLATFORM).deb + $(HostingBundleTimestampInstallerPackageName)-$(InstallerPlatform)-$(PACKAGE_CACHE_PLATFORM).deb + $(HostingBundleNoTimestampInstallerPackageName)-$(InstallerPlatform)-$(PACKAGE_CACHE_PLATFORM).deb - - - - + + - + - - - - + - - + + + + - - + + + + + + + + + + + + + @@ -656,5 +1013,23 @@ -n $(RUNTIMESTORE_NOTIMESTAMP_INSTALLERNAME) -v $(NoTimestampVersion)" WorkingDirectory="$(DotnetDebToolDirectory)" /> + + + + + + diff --git a/tools/RestoreRuntimeStore/NuGet.config b/tools/RestoreRuntimeStore/NuGet.config deleted file mode 100644 index e17aed4552..0000000000 --- a/tools/RestoreRuntimeStore/NuGet.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/tools/RestoreRuntimeStore/RestoreRuntimeStore.csproj b/tools/RestoreRuntimeStore/RestoreRuntimeStore.csproj deleted file mode 100644 index a0392260c4..0000000000 --- a/tools/RestoreRuntimeStore/RestoreRuntimeStore.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - netcoreapp2.0 - - - - - - - diff --git a/tools/docker/debian/Dockerfile b/tools/docker/debian.8/Dockerfile similarity index 100% rename from tools/docker/debian/Dockerfile rename to tools/docker/debian.8/Dockerfile diff --git a/tools/docker/rhel/Dockerfile b/tools/docker/rhel.7/Dockerfile similarity index 100% rename from tools/docker/rhel/Dockerfile rename to tools/docker/rhel.7/Dockerfile diff --git a/tools/changelog b/tools/packaging/changelog similarity index 100% rename from tools/changelog rename to tools/packaging/changelog diff --git a/tools/packaging/hosting_debian_config.json b/tools/packaging/hosting_debian_config.json new file mode 100644 index 0000000000..a01cf5cafc --- /dev/null +++ b/tools/packaging/hosting_debian_config.json @@ -0,0 +1,35 @@ +{ + "maintainer_name": "Microsoft", + "maintainer_email": "nugetaspnet@microsoft.com", + + "package_name": "dotnet-hosting", + "install_root": "/usr/share/dotnet", + + "short_description": "Microsoft .NET Core 2.0.0 Linux Server Hosting", + "long_description": "Microsoft .NET Core 2.0.0 Linux Server Hosting enables hosting of ASP.NET Core applications and contains the ASP.NET Core Runtime Package Store and .NET Core Runtime. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub (https://github.com/aspnet/home). We happily accept issues and PRs.", + "homepage": "https://www.asp.net/", + + "release":{ + "package_version":"0.0.0.0", + "package_revision":"1", + "urgency" : "low", + "changelog_message" : "" + }, + + "control": { + "priority":"standard", + "section":"devel", + "architecture":"any" + }, + + "copyright": "Microsoft", + "license": { + "type": "Apache-2.0", + "full_text": "Copyright (c) .NET Foundation. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthese files except in compliance with the License. You may obtain a copy of the\nLicense at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License." + }, + + "debian_dependencies": { + "dotnet-runtime-DOTNET_RUNTIME_VERSION": {}, + "aspnetcore-store-ASPNETCORE_STORE_VERSION": {} + } +} \ No newline at end of file diff --git a/tools/debian_config.json b/tools/packaging/store_debian_config.json similarity index 89% rename from tools/debian_config.json rename to tools/packaging/store_debian_config.json index 90be44d183..dfd9d9b499 100644 --- a/tools/debian_config.json +++ b/tools/packaging/store_debian_config.json @@ -1,11 +1,11 @@ { - "maintainer_name":"Microsoft", + "maintainer_name": "Microsoft", "maintainer_email": "nugetaspnet@microsoft.com", "package_name": "aspnetcore-store", "install_root": "/usr/share/dotnet", - "short_description": "Microsoft ASP.NET Core Runtime Package Store 2.0.0", + "short_description": "Microsoft ASP.NET Core 2.0.0 Runtime Package Store", "long_description": "Runtime package store for Microsoft ASP.NET Core. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub (https://github.com/aspnet/home). We happily accept issues and PRs.", "homepage": "https://www.asp.net/", @@ -13,7 +13,7 @@ "package_version":"0.0.0.0", "package_revision":"1", "urgency" : "low", - "changelog_message" : "Bootstrap loop package" + "changelog_message" : "" }, "control": { diff --git a/tools/GetSharedFrameworkVersion.ps1 b/tools/scripts/GetSharedFrameworkVersion.ps1 similarity index 100% rename from tools/GetSharedFrameworkVersion.ps1 rename to tools/scripts/GetSharedFrameworkVersion.ps1 diff --git a/tools/GetSharedFrameworkVersion.sh b/tools/scripts/GetSharedFrameworkVersion.sh similarity index 100% rename from tools/GetSharedFrameworkVersion.sh rename to tools/scripts/GetSharedFrameworkVersion.sh diff --git a/tools/InstallSharedFrameworkx86.ps1 b/tools/scripts/InstallSharedFrameworkx86.ps1 similarity index 100% rename from tools/InstallSharedFrameworkx86.ps1 rename to tools/scripts/InstallSharedFrameworkx86.ps1 diff --git a/tools/scripts/TestInstallers.sh b/tools/scripts/TestInstallers.sh new file mode 100755 index 0000000000..dbda428443 --- /dev/null +++ b/tools/scripts/TestInstallers.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash +set -e +set -o pipefail + +artifactsDir="artifacts/" +installersDir=$artifactsDir"installers/" +dotnetInstallersDir=$artifactsDir"dotnetInstallers/" +installerTestDir=$artifactsDir"installerTest/" + +# clean up test directory +if [ -d $installerTestDir ]; then + rm -r $installerTestDir +fi +mkdir $installerTestDir + +# copy dotnet installers +cp $dotnetInstallersDir*$DotnetInstallerSuffix $installerTestDir + +# copy store and hosting installers +cp $installersDir$StoreInstallerFile $installerTestDir +cp $installersDir$HostingInstallerFile $installerTestDir + +# test store install +(cd $installerTestDir && $InstallCommand $StoreInstallerFile) + +if [ ! -d $InstallRoot"additionalDeps" ]; then + echo $InstallRoot"additionalDeps missing after installing the runtime store." + exit 1 +fi +if [ ! -d $InstallRoot"store" ]; then + echo $InstallRoot"store missing after installing the runtime store." + exit 1 +fi + +# test store uninstall +$UninstallCommand $StoreInstallerPackageName + +if [ -d $InstallRoot"additionalDeps" ]; then + echo $InstallRoot"additionalDeps remains after uninstalling the runtime store." + exit 1 +fi +if [ -d $InstallRoot"store" ]; then + echo $InstallRoot"store remains after uninstalling the runtime store." + exit 1 +fi + +# test hosting install +(cd $installerTestDir && $InstallCommand *$InstallerExtension) + +if [ ! -d $InstallRoot"additionalDeps" ]; then + echo $InstallRoot"additionalDeps missing after installing the hosting bundle." + exit 1 +fi +if [ ! -d $InstallRoot"shared" ]; then + echo $InstallRoot"shared missing after installing the hosting bundle." + exit 1 +fi +if [ ! -d $InstallRoot"store" ]; then + echo $InstallRoot"store missing after installing the hosting bundle." + exit 1 +fi + +# test hosting uninstall +$UninstallCommand $HostingInstallerPackageName + +if [ ! -d $InstallRoot"additionalDeps" ]; then + echo $InstallRoot"additionalDeps missing after installing the hosting bundle." + exit 1 +fi +if [ ! -d $InstallRoot"shared" ]; then + echo $InstallRoot"shared missing after installing the hosting bundle." + exit 1 +fi +if [ ! -d $InstallRoot"store" ]; then + echo $InstallRoot"store missing after installing the hosting bundle." + exit 1 +fi diff --git a/tools/zip2tgz.sh b/tools/scripts/zip2tgz.sh similarity index 100% rename from tools/zip2tgz.sh rename to tools/scripts/zip2tgz.sh