static void WriteBuildNumber(OctoVersionInfo octoVersionInfo)
        {
            //##teamcity[buildNumber '<new build number>']
            var message = $"##teamcity[buildNumber '{octoVersionInfo.FullSemVer}']";

            System.Console.WriteLine(message);
        }
Пример #2
0
        public void Write(OctoVersionInfo octoVersionInfo)
        {
            const string prefix = ConfigurationBootstrapper.EnvironmentVariablePrefix;

            var properties = octoVersionInfo.GetType()
                             .GetProperties(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance);

            foreach (var property in properties)
            {
                var key   = $"{prefix}{property.Name}";
                var value = property.GetValue(octoVersionInfo)?.ToString() ?? string.Empty;
                var line  = $"{key}={value}";
                System.Console.WriteLine(line);
            }
        }
        static void WriteEnvironmentVariables(OctoVersionInfo octoVersionInfo)
        {
            // ##teamcity[setParameter name='ddd' value='fff']

            const string prefix     = ConfigurationBootstrapper.EnvironmentVariablePrefix;
            var          properties = octoVersionInfo.GetType()
                                      .GetProperties(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Instance);

            foreach (var property in properties)
            {
                var environmentVariableKey   = $"env.{prefix}{property.Name}";
                var configurationVariableKey = $"OctoVersion.{property.Name}";

                var value = property.GetValue(octoVersionInfo)?.ToString() ?? string.Empty;

                var environmentVariableMessage = $"##teamcity[setParameter name='{environmentVariableKey}' value='{value}']";
                System.Console.WriteLine(environmentVariableMessage);

                var configurationVariableMessage = $"##teamcity[setParameter name='{configurationVariableKey}' value='{value}']";
                System.Console.WriteLine(configurationVariableMessage);
            }
        }
Пример #4
0
 public void Write(OctoVersionInfo octoVersionInfo)
 {
     System.Console.WriteLine(octoVersionInfo);
 }
 public void Write(OctoVersionInfo octoVersionInfo)
 {
     WriteBuildNumber(octoVersionInfo);
     WriteEnvironmentVariables(octoVersionInfo);
 }
Пример #6
0
 public void Write(OctoVersionInfo octoVersionInfo)
 {
     context.Log.Information(octoVersionInfo);
 }
Пример #7
0
        public static void OctoVersion(this ICakeContext context, out OctoVersionInfo versionInfo)
        {
            var outputFormatter = GetOutputFormatter(context);

            OctoVersionRunnerWrapper.OctoVersion(out versionInfo, lc => WriteLogToSink(lc, outputFormatter));
        }
        public void Write(OctoVersionInfo octoVersionInfo)
        {
            var json = JsonConvert.SerializeObject(octoVersionInfo, Settings);

            System.Console.WriteLine(json);
        }