コード例 #1
0
        public static CICDJob Test(string repo_url, string user, string password, Topology.IGP.Topology igp_topology, Topology.MPLS.Topology mpls_topology)
        {
            CICDJob newJob = new CICDJob(repo_url, user, password, JobType.Test, igp_topology, mpls_topology);

            cicd_jobs.TryAdd(newJob.Id, newJob);

            return(newJob);
        }
コード例 #2
0
        public static CICDJob RemoveCICDJob(Guid jobId)
        {
            var r = new CICDJob();

            cicd_jobs.TryRemove(jobId, out r);

            return(r);
        }
コード例 #3
0
        public static CICDJob Build(string repo_url, string user, string password)
        {
            CICDJob newJob = new CICDJob(repo_url, user, password, JobType.Build);

            cicd_jobs.TryAdd(newJob.Id, newJob);

            return(newJob);
        }
コード例 #4
0
        public static CICDJob Deploy(string repo_url, string user, string password, Topology.IGP.Topology igp_topology, Topology.MPLS.Topology mpls_topology)
        {
            CICDJob newJob = new CICDJob(repo_url, user, password, JobType.Deploy, igp_topology, mpls_topology);

            // Update intent jobs concurrent dict
            newJob.OnJobCompletedCallback += (CICDJob cicdJob) => {
                foreach (var result in cicdJob.JobResults)
                {
                    if (result.IntentJob != null)
                    {
                        intent_jobs.AddOrUpdate(result.IntentJob.FileName, result.IntentJob, (k, v) => result.IntentJob);

                        IntentJobs.Set(intent_jobs.Count);
                    }
                }
            };

            cicd_jobs.TryAdd(newJob.Id, newJob);

            return(newJob);
        }