From 96664f31c2b28cb44df5c6a739aca52aa5f3ce13 Mon Sep 17 00:00:00 2001 From: Bryan Thornbury Date: Tue, 22 Mar 2016 14:14:54 -0700 Subject: [PATCH] Add publishing for sdk, sharedhost, sharedfx deb files small fix disable dotnet-nightly train avoidance, alawys use the same debian config for now --- packaging/debian/dotnet-debian_config.json | 4 -- scripts/dotnet-cli-build/DebTargets.cs | 2 +- scripts/dotnet-cli-build/PublishTargets.cs | 50 ++++++++++++++++++++-- scripts/package/package-debian.sh | 2 +- 4 files changed, 48 insertions(+), 10 deletions(-) diff --git a/packaging/debian/dotnet-debian_config.json b/packaging/debian/dotnet-debian_config.json index 73fbcc6cc..154e764fe 100644 --- a/packaging/debian/dotnet-debian_config.json +++ b/packaging/debian/dotnet-debian_config.json @@ -33,10 +33,6 @@ "%SHARED_FRAMEWORK_DEBIAN_PACKAGE_NAME%" : {} }, - "package_conflicts" : [ - "dotnet-dev-nightly" - ], - "symlinks": { "bin/dotnet-compile-native" : "/usr/bin/dotnet-compile-native" } diff --git a/scripts/dotnet-cli-build/DebTargets.cs b/scripts/dotnet-cli-build/DebTargets.cs index 7382e9224..fe8da8ce2 100644 --- a/scripts/dotnet-cli-build/DebTargets.cs +++ b/scripts/dotnet-cli-build/DebTargets.cs @@ -168,7 +168,7 @@ namespace Microsoft.DotNet.Cli.Build { IEnumerable orderedPackageNames = new List() { - Monikers.GetDebianPackageName(c), + Monikers.GetSdkDebianPackageName(c), Monikers.GetDebianSharedFrameworkPackageName(c), Monikers.GetDebianSharedHostPackageName(c) }; diff --git a/scripts/dotnet-cli-build/PublishTargets.cs b/scripts/dotnet-cli-build/PublishTargets.cs index 57ca32a2f..4da9545c0 100644 --- a/scripts/dotnet-cli-build/PublishTargets.cs +++ b/scripts/dotnet-cli-build/PublishTargets.cs @@ -47,7 +47,7 @@ namespace Microsoft.DotNet.Cli.Build [Target( nameof(PublishTargets.PublishVersionBadge), nameof(PublishTargets.PublishSdkInstallerFile), - //nameof(PublishTargets.PublishDebFileToDebianRepo), + nameof(PublishTargets.PublishDebFilesToDebianRepo), nameof(PublishTargets.PublishCombinedFrameworkSDKHostFile), nameof(PublishTargets.PublishCombinedFrameworkHostFile), nameof(PublishTargets.PublishLatestVersionTextFile))] @@ -93,11 +93,21 @@ namespace Microsoft.DotNet.Cli.Build return c.Success(); } - [Target(nameof(PublishSdkInstallerFile))] + [Target( + nameof(PublishSdkDebToDebianRepo), + nameof(PublishSharedFrameworkDebToDebianRepo), + nameof(PublishSharedHostDebToDebianRepo))] [BuildPlatforms(BuildPlatform.Ubuntu)] - public static BuildTargetResult PublishDebFileToDebianRepo(BuildTargetContext c) + public static BuildTargetResult PublishDebFilesToDebianRepo(BuildTargetContext c) { - var packageName = Monikers.GetDebianPackageName(c); + return c.Success(); + } + + [Target] + [BuildPlatforms(BuildPlatform.Ubuntu)] + public static BuildTargetResult PublishSdkDebToDebianRepo(BuildTargetContext c) + { + var packageName = Monikers.GetSdkDebianPackageName(c); var installerFile = c.BuildContext.Get("SdkInstallerFile"); var uploadUrl = $"https://dotnetcli.blob.core.windows.net/dotnet/{Channel}/Installers/{Version}/{Path.GetFileName(installerFile)}"; var uploadJson = GenerateUploadJsonFile(packageName, Version, uploadUrl); @@ -109,6 +119,38 @@ namespace Microsoft.DotNet.Cli.Build return c.Success(); } + [Target] + [BuildPlatforms(BuildPlatform.Ubuntu)] + public static BuildTargetResult PublishSharedFrameworkDebToDebianRepo(BuildTargetContext c) + { + var packageName = Monikers.GetDebianSharedFrameworkPackageName(c); + var installerFile = c.BuildContext.Get("SharedFrameworkInstallerFile"); + var uploadUrl = $"https://dotnetcli.blob.core.windows.net/dotnet/{Channel}/Installers/{Version}/{Path.GetFileName(installerFile)}"; + var uploadJson = GenerateUploadJsonFile(packageName, Version, uploadUrl); + + Cmd(Path.Combine(Dirs.RepoRoot, "scripts", "publish", "repoapi_client.sh"), "-addpkg", uploadJson) + .Execute() + .EnsureSuccessful(); + + return c.Success(); + } + + [Target] + [BuildPlatforms(BuildPlatform.Ubuntu)] + public static BuildTargetResult PublishSharedHostDebToDebianRepo(BuildTargetContext c) + { + var packageName = Monikers.GetDebianSharedHostPackageName(c); + var installerFile = c.BuildContext.Get("SharedHostInstallerFile"); + var uploadUrl = $"https://dotnetcli.blob.core.windows.net/dotnet/{Channel}/Installers/{Version}/{Path.GetFileName(installerFile)}"; + var uploadJson = GenerateUploadJsonFile(packageName, Version, uploadUrl); + + Cmd(Path.Combine(Dirs.RepoRoot, "scripts", "publish", "repoapi_client.sh"), "-addpkg", uploadJson) + .Execute() + .EnsureSuccessful(); + + return c.Success(); + } + [Target] [Environment("DOCKER_HUB_REPO")] [Environment("DOCKER_HUB_TRIGGER_TOKEN")] diff --git a/scripts/package/package-debian.sh b/scripts/package/package-debian.sh index ec008683b..fa5d5268c 100755 --- a/scripts/package/package-debian.sh +++ b/scripts/package/package-debian.sh @@ -167,7 +167,7 @@ copy_files_to_debian_layout(){ cp -a "$REPO_BINARIES_DIR/." "$PACKAGE_LAYOUT_DIR/package_root" # Copy config file - cp "$PACKAGING_ROOT/$DOTNET_DEB_PACKAGE_NAME-debian_config.json" "$PACKAGE_LAYOUT_DIR/debian_config.json" + cp "$PACKAGING_ROOT/dotnet-debian_config.json" "$PACKAGE_LAYOUT_DIR/debian_config.json" # Copy Manpages cp -a "$MANPAGE_DIR/." "$PACKAGE_LAYOUT_DIR/docs"