Beispiel #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());
            }

            var sharedFrameworkNugetVersion = c.BuildContext.Get <string>("SharedFrameworkNugetVersion");
            var hostFxrVersion = c.BuildContext.Get <HostVersion>("HostVersion").LockedHostFxrVersion.ToString();

            IEnumerable <string> orderedPackageNames = new List <string>()
            {
                Monikers.GetDebianSharedFrameworkPackageName(sharedFrameworkNugetVersion),
                Monikers.GetDebianHostFxrPackageName(hostFxrVersion),
                Monikers.GetDebianSharedHostPackageName(c)
            };

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

            return(c.Success());
        }
Beispiel #2
0
        public static BuildTargetResult GenerateSharedHostDeb(BuildTargetContext c)
        {
            var packageName      = Monikers.GetDebianSharedHostPackageName(c);
            var version          = c.BuildContext.Get <HostVersion>("HostVersion").LockedHostVersion.ToString();
            var inputRoot        = c.BuildContext.Get <string>("SharedHostPublishRoot");
            var debFile          = c.BuildContext.Get <string>("SharedHostInstallerFile");
            var manPagesDir      = Path.Combine(Dirs.RepoRoot, "Documentation", "manpages");
            var debianConfigFile = Path.Combine(Dirs.DebPackagingConfig, "dotnet-sharedhost-debian_config.json");

            var debianConfigVariables = new Dictionary <string, string>()
            {
                { "SHARED_HOST_BRAND_NAME", Monikers.SharedHostBrandName }
            };

            var debCreator = new DebPackageCreator(
                DotNetCli.Stage0,
                Dirs.Intermediate,
                dotnetDebToolPackageSource: Dirs.Packages);

            debCreator.CreateDeb(
                debianConfigFile,
                packageName,
                version,
                inputRoot,
                debianConfigVariables,
                debFile,
                manPagesDir);

            return(c.Success());
        }
Beispiel #3
0
        public static BuildTargetResult PublishSharedHostDebToDebianRepo(BuildTargetContext c)
        {
            var version = SharedHostNugetVersion;

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

            DebRepoPublisherTool.PublishDebFileToDebianRepo(
                packageName,
                version,
                uploadUrl);

            return(c.Success());
        }
Beispiel #4
0
        public static BuildTargetResult RemovePackages(BuildTargetContext c)
        {
            IEnumerable <string> orderedPackageNames = new List <string>()
            {
                Monikers.GetDebianSharedFrameworkPackageName(c),
                Monikers.GetDebianSharedHostPackageName(c)
            };

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

            return(c.Success());
        }
Beispiel #5
0
        public static BuildTargetResult GenerateSharedHostDeb(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(GenerateSharedHostDeb)}");
                return(c.Success());
            }

            var packageName      = Monikers.GetDebianSharedHostPackageName(c);
            var version          = c.BuildContext.Get <HostVersion>("HostVersion").LockedHostVersion.ToString();
            var inputRoot        = c.BuildContext.Get <string>("SharedHostPublishRoot");
            var debFile          = c.BuildContext.Get <string>("SharedHostInstallerFile");
            var manPagesDir      = Path.Combine(Dirs.RepoRoot, "Documentation", "manpages");
            var debianConfigFile = Path.Combine(Dirs.DebPackagingConfig, "dotnet-sharedhost-debian_config.json");

            var debianConfigVariables = new Dictionary <string, string>()
            {
                { "SHARED_HOST_BRAND_NAME", Monikers.GetSharedHostBrandName(c) }
            };

            var debCreator = new DebPackageCreator(
                DotNetCli.Stage0,
                Dirs.Intermediate,
                dotnetDebToolPackageSource: Dirs.Packages);

            debCreator.CreateDeb(
                debianConfigFile,
                packageName,
                version,
                inputRoot,
                debianConfigVariables,
                debFile,
                manPagesDir);

            return(c.Success());
        }
Beispiel #6
0
        public static BuildTargetResult GenerateSharedHostDeb(BuildTargetContext c)
        {
            var packageName = Monikers.GetDebianSharedHostPackageName(c);
            var version     = c.BuildContext.Get <HostVersion>("HostVersion").LockedHostVersion;
            var inputRoot   = c.BuildContext.Get <string>("SharedHostPublishRoot");
            var debFile     = c.BuildContext.Get <string>("SharedHostInstallerFile");
            var objRoot     = Path.Combine(Dirs.Output, "obj", "debian", "sharedhost");
            var manPagesDir = Path.Combine(Dirs.RepoRoot, "Documentation", "manpages");

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

            Directory.CreateDirectory(objRoot);

            Cmd(Path.Combine(Dirs.RepoRoot, "packaging", "deb-package", "host", "package-sharedhost-debian.sh"),
                "--input", inputRoot, "--output", debFile, "-b", Monikers.SharedHostBrandName,
                "--obj-root", objRoot, "--version", version, "-m", manPagesDir)
            .Execute()
            .EnsureSuccessful();
            return(c.Success());
        }