Exemplo n.º 1
0
        public static BuildTargetResult RemovePackages(BuildTargetContext c)
        {
            // Ubuntu 16.04 Jenkins Machines don't have docker or debian package build tools
            // So we need to skip this target if the tools aren't present.
            // https://github.com/dotnet/core-setup/issues/167
            if (DebuildNotPresent())
            {
                c.Info("Debuild not present, skipping target: {nameof(RemovePackages)}");
                return(c.Success());
            }

            IEnumerable <string> orderedPackageNames = new List <string>()
            {
                CliMonikers.GetSdkDebianPackageName(c),
                Monikers.GetDebianSharedFrameworkPackageName(CliDependencyVersions.SharedFrameworkVersion),
                Monikers.GetDebianHostFxrPackageName(CliDependencyVersions.HostFxrVersion),
                Monikers.GetDebianSharedHostPackageName(c)
            };

            foreach (var packageName in orderedPackageNames)
            {
                RemovePackage(packageName);
            }

            return(c.Success());
        }
Exemplo n.º 2
0
        public static BuildTargetResult GenerateSdkDeb(BuildTargetContext c)
        {
            var channel                   = c.BuildContext.Get <string>("Channel").ToLower();
            var packageName               = Monikers.GetSdkDebianPackageName(c);
            var version                   = c.BuildContext.Get <BuildVersion>("BuildVersion").NuGetVersion;
            var debFile                   = c.BuildContext.Get <string>("SdkInstallerFile");
            var manPagesDir               = Path.Combine(Dirs.RepoRoot, "Documentation", "manpages");
            var previousVersionURL        = $"https://dotnetcli.blob.core.windows.net/dotnet/{channel}/Installers/Latest/dotnet-ubuntu-x64.latest.deb";
            var sdkPublishRoot            = c.BuildContext.Get <string>("CLISDKRoot");
            var sharedFxDebianPackageName = Monikers.GetDebianSharedFrameworkPackageName(c);

            var objRoot = Path.Combine(Dirs.Output, "obj", "debian", "sdk");

            if (Directory.Exists(objRoot))
            {
                Directory.Delete(objRoot, true);
            }

            Directory.CreateDirectory(objRoot);

            Cmd(Path.Combine(Dirs.RepoRoot, "scripts", "package", "package-debian.sh"),
                "-v", version,
                "-i", sdkPublishRoot,
                "-o", debFile,
                "-p", packageName,
                "-m", manPagesDir,
                "--framework-debian-package-name", sharedFxDebianPackageName,
                "--framework-nuget-name", Monikers.SharedFrameworkName,
                "--framework-nuget-version", c.BuildContext.Get <string>("SharedFrameworkNugetVersion"),
                "--previous-version-url", previousVersionURL,
                "--obj-root", objRoot)
            .Execute()
            .EnsureSuccessful();
            return(c.Success());
        }
Exemplo n.º 3
0
        public static BuildTargetResult PublishSharedFrameworkDebToDebianRepo(BuildTargetContext c)
        {
            var version = SharedFrameworkNugetVersion;

            var packageName   = Monikers.GetDebianSharedFrameworkPackageName(c);
            var installerFile = c.BuildContext.Get <string>("SharedFrameworkInstallerFile");
            var uploadUrl     = AzurePublisherTool.CalculateInstallerUploadUrl(installerFile, Channel, version);

            DebRepoPublisherTool.PublishDebFileToDebianRepo(
                packageName,
                version,
                uploadUrl);

            return(c.Success());
        }
Exemplo n.º 4
0
        public static BuildTargetResult GenerateSdkDeb(BuildTargetContext c)
        {
            // Ubuntu 16.04 Jenkins Machines don't have docker or debian package build tools
            // So we need to skip this target if the tools aren't present.
            // https://github.com/dotnet/core-setup/issues/167
            if (DebuildNotPresent())
            {
                c.Info("Debuild not present, skipping target: {nameof(RemovePackages)}");
                return(c.Success());
            }

            var channel                   = c.BuildContext.Get <string>("Channel").ToLower();
            var packageName               = CliMonikers.GetSdkDebianPackageName(c);
            var version                   = c.BuildContext.Get <BuildVersion>("BuildVersion").NuGetVersion;
            var debFile                   = c.BuildContext.Get <string>("SdkInstallerFile");
            var manPagesDir               = Path.Combine(Dirs.RepoRoot, "Documentation", "manpages");
            var sdkPublishRoot            = c.BuildContext.Get <string>("CLISDKRoot");
            var sharedFxDebianPackageName = Monikers.GetDebianSharedFrameworkPackageName(CliDependencyVersions.SharedFrameworkVersion);
            var debianConfigFile          = Path.Combine(Dirs.DebPackagingConfig, "dotnet-debian_config.json");
            var postinstallFile           = Path.Combine(Dirs.DebPackagingConfig, "postinst");

            var debianConfigVariables = new Dictionary <string, string>()
            {
                { "SHARED_FRAMEWORK_DEBIAN_PACKAGE_NAME", sharedFxDebianPackageName },
                { "SHARED_FRAMEWORK_NUGET_NAME", Monikers.SharedFrameworkName },
                { "SHARED_FRAMEWORK_NUGET_VERSION", CliDependencyVersions.SharedFrameworkVersion },
                { "SHARED_FRAMEWORK_BRAND_NAME", Monikers.SharedFxBrandName },
                { "SDK_NUGET_VERSION", version },
                { "CLI_SDK_BRAND_NAME", Monikers.CLISdkBrandName }
            };

            var debCreator = new DebPackageCreator(
                DotNetCli.Stage2,
                Dirs.Intermediate);

            debCreator.CreateDeb(
                debianConfigFile,
                packageName,
                version,
                sdkPublishRoot,
                debianConfigVariables,
                debFile,
                manpagesDirectory: manPagesDir,
                versionManpages: true,
                debianFiles: new string[] { postinstallFile });

            return(c.Success());
        }
Exemplo n.º 5
0
        public static BuildTargetResult RemovePackages(BuildTargetContext c)
        {
            IEnumerable <string> orderedPackageNames = new List <string>()
            {
                Monikers.GetSdkDebianPackageName(c),
                Monikers.GetDebianSharedFrameworkPackageName(c),
                Monikers.GetDebianSharedHostPackageName(c)
            };

            foreach (var packageName in orderedPackageNames)
            {
                RemovePackage(packageName);
            }

            return(c.Success());
        }
Exemplo n.º 6
0
        public static BuildTargetResult GenerateSdkDeb(BuildTargetContext c)
        {
            // Ubuntu 16.04 Jenkins Machines don't have docker or debian package build tools
            // So we need to skip this target if the tools aren't present.
            // https://github.com/dotnet/core-setup/issues/167
            if (DebuildNotPresent())
            {
                c.Info("Debuild not present, skipping target: {nameof(RemovePackages)}");
                return(c.Success());
            }

            var channel                   = c.BuildContext.Get <string>("Channel").ToLower();
            var packageName               = CliMonikers.GetSdkDebianPackageName(c);
            var version                   = c.BuildContext.Get <BuildVersion>("BuildVersion").NuGetVersion;
            var debFile                   = c.BuildContext.Get <string>("SdkInstallerFile");
            var manPagesDir               = Path.Combine(Dirs.RepoRoot, "Documentation", "manpages");
            var previousVersionURL        = $"https://dotnetcli.blob.core.windows.net/dotnet/{channel}/Installers/Latest/dotnet-ubuntu-x64.latest.deb";
            var sdkPublishRoot            = c.BuildContext.Get <string>("CLISDKRoot");
            var sharedFxDebianPackageName = Monikers.GetDebianSharedFrameworkPackageName(CliDependencyVersions.SharedFrameworkVersion);

            var objRoot = Path.Combine(Dirs.Output, "obj", "debian", "sdk");

            if (Directory.Exists(objRoot))
            {
                Directory.Delete(objRoot, true);
            }

            Directory.CreateDirectory(objRoot);

            Cmd(Path.Combine(Dirs.RepoRoot, "scripts", "package", "package-debian.sh"),
                "-v", version,
                "-i", sdkPublishRoot,
                "-o", debFile,
                "-p", packageName,
                "-b", Monikers.CLISdkBrandName,
                "-m", manPagesDir,
                "--framework-debian-package-name", sharedFxDebianPackageName,
                "--framework-nuget-name", Monikers.SharedFrameworkName,
                "--framework-nuget-version", CliDependencyVersions.SharedFrameworkVersion,
                "--previous-version-url", previousVersionURL,
                "--obj-root", objRoot)
            .Execute()
            .EnsureSuccessful();
            return(c.Success());
        }
Exemplo n.º 7
0
        public static BuildTargetResult GenerateSharedFrameworkDeb(BuildTargetContext c)
        {
            var packageName = Monikers.GetDebianSharedFrameworkPackageName(c);
            var version     = c.BuildContext.Get <string>("SharedFrameworkNugetVersion");
            var inputRoot   = c.BuildContext.Get <string>("SharedFrameworkPublishRoot");
            var debFile     = c.BuildContext.Get <string>("SharedFrameworkInstallerFile");
            var objRoot     = Path.Combine(Dirs.Output, "obj", "debian", "sharedframework");

            if (Directory.Exists(objRoot))
            {
                Directory.Delete(objRoot, true);
            }

            Directory.CreateDirectory(objRoot);

            Cmd(Path.Combine(Dirs.RepoRoot, "scripts", "package", "package-sharedframework-debian.sh"),
                "--input", inputRoot, "--output", debFile, "--package-name", packageName, "-b", Monikers.SharedFxBrandName,
                "--framework-nuget-name", Monikers.SharedFrameworkName,
                "--framework-nuget-version", c.BuildContext.Get <string>("SharedFrameworkNugetVersion"),
                "--obj-root", objRoot, "--version", version)
            .Execute()
            .EnsureSuccessful();
            return(c.Success());
        }