Пример #1
0
        public EldersCI(GocdClient gocd, App app)
        {
            this.app  = app;
            this.gocd = gocd;

            c3poSpeakProgram.AddVoiceInterface(C3poVoiceInterface.LibLog);
        }
Пример #2
0
        static void Main(string[] args)
        {
            System.Net.ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicyErrors) => true);

            Uri    server         = new Uri(args[0]);
            string username       = args[1];
            string password       = args[2];
            string appName        = args[3];
            string repositoryPath = args[4];


            C3poSpeachProgram c3poSpeakProgram = new C3poSpeachProgram();

            c3poSpeakProgram.AddVoiceInterface(C3poVoiceInterface.Console);

            #region GOCD
            var gocdOptions = new GocdClient.Options(server);
            var auth        = new Authenticator(Convert.ToBase64String(Encoding.UTF8.GetBytes($"{username}:{password}")));
            var gocd        = new GocdClient(gocdOptions, c3poSpeakProgram, auth);
            #endregion

            var elders = new EldersCI(gocd, c3poSpeakProgram);

            if (appName.Equals("mono-repo", StringComparison.OrdinalIgnoreCase))
            {
                string workingDir = repositoryPath ?? ".";
                var    bcs        = Directory.GetDirectories(workingDir).Where(dir => dir.EndsWith(".git") == false).Select(x => new DirectoryInfo(x));

                foreach (var bc in bcs)
                {
                    var appSettings = new App.Settings(bc.Name, workingDir);
                    var app         = new App(appSettings);
                    elders.SetApp(app);
                    elders.Magic();
                }
            }
            else
            {
                var appSettings = new App.Settings(appName, repositoryPath);
                var app         = new App(appSettings);
                elders.SetApp(app);
                elders.Magic();
            }

            elders.Dispose();
        }
Пример #3
0
 public EldersCI(GocdClient gocd, C3poSpeachProgram c3poSpeakProgram)
 {
     this.gocd             = gocd;
     this.c3poSpeakProgram = c3poSpeakProgram;
     c3poSpeakProgram.AddVoiceInterface(C3poVoiceInterface.LibLog);
 }