Beispiel #1
0
        private static bool CheckIfAllBuildsHavePublished()
        {
            Dictionary <string, bool> badges = new Dictionary <string, bool>()
            {
                { "sharedfx_Windows_x86", false },
                { "sharedfx_Windows_x64", false },
                { "sharedfx_Ubuntu_x64", false },
                { "sharedfx_Ubuntu_16_04_x64", false },
                { "sharedfx_Ubuntu_16_10_x64", false },
                { "sharedfx_RHEL_x64", false },
                { "sharedfx_OSX_x64", false },
                { "sharedfx_Debian_x64", false },
                { "sharedfx_CentOS_x64", false },
                { "sharedfx_Fedora_23_x64", false },
                { "sharedfx_openSUSE_13_2_x64", false },
                { "sharedfx_openSUSE_42_1_x64", false }
            };

            List <string> blobs = new List <string>(AzurePublisherTool.ListBlobs($"{Channel}/Binaries/{SharedFrameworkNugetVersion}/"));

            var versionBadgeName = $"sharedfx_{Monikers.GetBadgeMoniker()}";

            if (badges.ContainsKey(versionBadgeName) == false)
            {
                throw new ArgumentException($"A new OS build ({versionBadgeName}) was added without adding the moniker to the {nameof(badges)} lookup");
            }

            foreach (string file in blobs)
            {
                string name = Path.GetFileName(file);
                string key  = string.Empty;

                foreach (string img in badges.Keys)
                {
                    if ((name.StartsWith($"{img}")) && (name.EndsWith(".svg")))
                    {
                        key = img;
                        break;
                    }
                }

                if (string.IsNullOrEmpty(key) == false)
                {
                    badges[key] = true;
                }
            }

            return(badges.Keys.All(key => badges[key]));
        }
Beispiel #2
0
        public static BuildTargetResult ExpectedBuildArtifacts(BuildTargetContext c)
        {
            var config           = Environment.GetEnvironmentVariable("CONFIGURATION");
            var versionBadgeName = $"sharedfx_{Monikers.GetBadgeMoniker()}_{config}_version_badge.svg";

            c.BuildContext["VersionBadge"] = Path.Combine(Dirs.Output, versionBadgeName);

            var sharedFrameworkVersion = c.BuildContext.Get <string>("SharedFrameworkNugetVersion");
            var hostVersion            = c.BuildContext.Get <HostVersion>("HostVersion").LockedHostVersion.ToString();

            AddInstallerArtifactToContext(c, "dotnet-host", "SharedHost", hostVersion);
            AddInstallerArtifactToContext(c, "dotnet-sharedframework", "SharedFramework", sharedFrameworkVersion);
            AddInstallerArtifactToContext(c, "dotnet", "CombinedFrameworkHost", sharedFrameworkVersion);

            return(c.Success());
        }
Beispiel #3
0
        public static BuildTargetResult ExpectedBuildArtifacts(BuildTargetContext c)
        {
            var config           = c.BuildContext.Get <string>("Configuration");
            var versionBadgeName = $"sharedfx_{Monikers.GetBadgeMoniker(c)}_{config}_version_badge.svg";

            c.BuildContext["VersionBadge"] = Path.Combine(Dirs.Output, versionBadgeName);

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

            AddInstallerArtifactToContext(c, "dotnet-host", "SharedHost", hostVersion);
            AddInstallerArtifactToContext(c, "dotnet-hostfxr", "HostFxr", hostFxrVersion);
            AddInstallerArtifactToContext(c, "dotnet-sharedframework", "SharedFramework", sharedFrameworkVersion);
            AddInstallerArtifactToContext(c, "dotnet-sharedframework-symbols", "SharedFrameworkSymbols", sharedFrameworkVersion);
            AddInstallerArtifactToContext(c, "dotnet", "CombinedMuxerHostFxrFramework", sharedFrameworkVersion);

            return(c.Success());
        }
Beispiel #4
0
        private static bool CheckIfAllBuildsHavePublished()
        {
            Dictionary <string, bool> badges = new Dictionary <string, bool>()
            {
                { "sharedfx_Windows_x86", false },
                { "sharedfx_Windows_x64", false },
                { "sharedfx_Windows_arm", false },
                { "sharedfx_Windows_arm64", false },
                { "sharedfx_Linux_x64", false },
                { "sharedfx_Ubuntu_x64", false },
                // { "sharedfx_Ubuntu_14_04_arm", false },
                { "sharedfx_Ubuntu_16_04_x64", false },
                // { "sharedfx_Ubuntu_16_04_arm", false },
                { "sharedfx_Ubuntu_16_10_x64", false },
                { "sharedfx_RHEL_x64", false },
                { "sharedfx_OSX_x64", false },
                { "sharedfx_Debian_x64", false },
                { "sharedfx_CentOS_x64", false },
                { "sharedfx_Fedora_23_x64", false },
                { "sharedfx_Fedora_24_x64", false },
                { "sharedfx_openSUSE_13_2_x64", false },
                { "sharedfx_openSUSE_42_1_x64", false }
            };

            List <string> blobs = new List <string>(AzurePublisherTool.ListBlobs($"{Channel}/Binaries/{SharedFrameworkNugetVersion}/"));

            var versionBadgeName = $"sharedfx_{Monikers.GetBadgeMoniker()}";

            if (badges.ContainsKey(versionBadgeName) == false)
            {
                throw new ArgumentException($"A new OS build ({versionBadgeName}) was added without adding the moniker to the {nameof(badges)} lookup");
            }

            foreach (string file in blobs)
            {
                string name = Path.GetFileName(file);

                if (!name.EndsWith(".svg"))
                {
                    continue;
                }

                // Include _ delimiter when matching to prevent finding both arm and arm64 badges
                // when checking the arm badge file.
                string[] matchingBadgeKeys = badges.Keys
                                             .Where(badgeName => name.StartsWith($"{badgeName}_"))
                                             .ToArray();

                if (matchingBadgeKeys.Length == 1)
                {
                    badges[matchingBadgeKeys[0]] = true;
                }
                else if (matchingBadgeKeys.Length > 1)
                {
                    throw new BuildFailureException(
                              $"Expected 0 or 1 badges matching file '{name}', " +
                              $"found {matchingBadgeKeys.Length}: " +
                              string.Join(", ", matchingBadgeKeys));
                }
            }

            foreach (string unfinishedBadge in badges.Where(pair => !pair.Value).Select(pair => pair.Key))
            {
                Console.WriteLine($"Not all builds complete, badge not found: {unfinishedBadge}");
            }

            return(badges.Keys.All(key => badges[key]));
        }