Пример #1
0
        public static bool Register()
        {
            var response = GitLabAPI.RegisterRunner(SSHKey.GetPublicKey(),
                                                    Config.RegisterToken);

            if (response == null)
            {
                return(false);
            }

            Config.AuthToken = response;
            return(true);
        }
Пример #2
0
        /// <summary>
        /// Get a new build job
        /// </summary>
        private static void GetBuild()
        {
            var buildInfo = GitLabAPI.GetBuild();

            if (buildInfo != null)
            {
                var conf = new BuildConfiguration();

                // Create Build Job
                build = new Build()
                {
                    Info = buildInfo
                };
                Console.WriteLine("[" + DateTime.Now + "] Build " + buildInfo.Value.id
                                  + " started...");

                var thread = new Thread(build.Start);
                thread.Start();
            }
        }
Пример #3
0
        /// <summary>
        /// PUSH Build Status to Gitlab CI
        /// </summary>
        /// <returns>true on success, false on fail</returns>
        private static bool PushBuild()
        {
            var buildInfo = (GitLabAPI.BuildInfo)build.Info;

            return(GitLabAPI.PushBuild(buildInfo.id, build.State, build.Output.ToString()));
        }