Пример #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());
        }
Пример #2
0
        public static BuildTargetResult GenerateSharedFrameworkDeb(BuildTargetContext c)
        {
            var packageName       = Monikers.GetDebianSharedFrameworkPackageName(c);
            var sharedHostVersion = c.BuildContext.Get <HostVersion>("HostVersion").LockedHostVersion;
            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, "packaging", "deb-package", "sharedframework", "package-sharedframework-debian.sh"),
                "--input", inputRoot, "--output", debFile, "--package-name", packageName, "-b", Monikers.SharedFxBrandName,
                "--shared-host-version", sharedHostVersion,
                "--framework-nuget-name", Monikers.SharedFrameworkName,
                "--framework-nuget-version", c.BuildContext.Get <string>("SharedFrameworkNugetVersion"),
                "--obj-root", objRoot, "--version", version)
            .Execute()
            .EnsureSuccessful();
            return(c.Success());
        }
Пример #3
0
        public static BuildTargetResult GenerateSharedFrameworkDeb(BuildTargetContext c)
        {
            var sharedFrameworkNugetVersion = c.BuildContext.Get <string>("SharedFrameworkNugetVersion");
            var packageName       = Monikers.GetDebianSharedFrameworkPackageName(sharedFrameworkNugetVersion);
            var sharedHostVersion = c.BuildContext.Get <HostVersion>("HostVersion").LockedHostVersion.ToString();
            var version           = c.BuildContext.Get <string>("SharedFrameworkNugetVersion");
            var inputRoot         = c.BuildContext.Get <string>("SharedFrameworkPublishRoot");
            var debFile           = c.BuildContext.Get <string>("SharedFrameworkInstallerFile");
            var debianConfigFile  = Path.Combine(Dirs.DebPackagingConfig, "dotnet-sharedframework-debian_config.json");

            var debianConfigVariables = new Dictionary <string, string>()
            {
                { "SHARED_HOST_DEBIAN_VERSION", sharedHostVersion },
                { "SHARED_FRAMEWORK_DEBIAN_PACKAGE_NAME", packageName },
                { "SHARED_FRAMEWORK_NUGET_NAME", Monikers.SharedFrameworkName },
                { "SHARED_FRAMEWORK_NUGET_VERSION", c.BuildContext.Get <string>("SharedFrameworkNugetVersion") },
                { "SHARED_FRAMEWORK_BRAND_NAME", Monikers.SharedFxBrandName }
            };

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

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

            return(c.Success());
        }
Пример #4
0
        public static BuildTargetResult PublishSharedFrameworkDebToDebianRepo(BuildTargetContext c)
        {
            var version = SharedFrameworkNugetVersion;

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

            DebRepoPublisherTool.PublishDebFileToDebianRepo(
                packageName,
                version,
                uploadUrl);

            return(c.Success());
        }
Пример #5
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());
        }
Пример #6
0
        public static BuildTargetResult GenerateSharedFrameworkDeb(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(GenerateSharedFrameworkDeb)}");
                return(c.Success());
            }

            var sharedFrameworkNugetVersion = c.BuildContext.Get <string>("SharedFrameworkNugetVersion");
            var packageName              = Monikers.GetDebianSharedFrameworkPackageName(sharedFrameworkNugetVersion);
            var sharedHostVersion        = c.BuildContext.Get <HostVersion>("HostVersion").LockedHostVersion.ToString();
            var hostFxrVersion           = c.BuildContext.Get <HostVersion>("HostVersion").LockedHostFxrVersion.ToString();
            var hostfxrDebianPackageName = Monikers.GetDebianHostFxrPackageName(hostFxrVersion);
            var version          = c.BuildContext.Get <string>("SharedFrameworkNugetVersion");
            var inputRoot        = c.BuildContext.Get <string>("SharedFrameworkPublishRoot");
            var debFile          = c.BuildContext.Get <string>("SharedFrameworkInstallerFile");
            var debianConfigFile = Path.Combine(Dirs.DebPackagingConfig, "dotnet-sharedframework-debian_config.json");

            var debianConfigVariables = new Dictionary <string, string>()
            {
                { "SHARED_HOST_DEBIAN_VERSION", sharedHostVersion },
                { "HOSTFXR_DEBIAN_PACKAGE_NAME", hostfxrDebianPackageName },
                { "HOSTFXR_DEBIAN_VERSION", hostFxrVersion },
                { "SHARED_FRAMEWORK_DEBIAN_PACKAGE_NAME", packageName },
                { "SHARED_FRAMEWORK_NUGET_NAME", Monikers.SharedFrameworkName },
                { "SHARED_FRAMEWORK_NUGET_VERSION", c.BuildContext.Get <string>("SharedFrameworkNugetVersion") },
                { "SHARED_FRAMEWORK_BRAND_NAME", Monikers.GetSharedFxBrandName(c) }
            };

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

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

            return(c.Success());
        }