Exemple #1
0
        public void FindByIdTest()
        {
            DeploymentStore store = new DeploymentStore();
            Deployment      pi    = store.FindById(Guid.NewGuid());

            Assert.IsNull(pi);
            store.Dispose();
        }
Exemple #2
0
 public void DeploymentStoreTest1()
 {
     using (BpmDbContext db = new BpmDbContext())
     {
         DeploymentStore store = new DeploymentStore(db);
         Assert.IsNotNull(store);
     }
 }
Exemple #3
0
        public void MultipleSelect()
        {
            DeploymentStore store = new DeploymentStore();
            Deployment      pi    = new Deployment()
            {
                DeploymentCategory = "DeploymentCategory",
                DeploymentTenantId = "DeploymentTenantId",
                DeploymentVersion  = "1.0"
            };

            store.Create(pi);

            Deployment pi2 = store.FindById(pi.DeploymentId);
            Deployment pi3 = store.FindById(pi.DeploymentId);
            Deployment pi4 = store.FindById(pi.DeploymentId);
        }
Exemple #4
0
        public void CRUDTest()
        {
            DeploymentStore store = new DeploymentStore();
            Deployment      pi    = new Deployment()
            {
                DeploymentCategory = "DeploymentCategory",
                DeploymentTenantId = "DeploymentTenantId",
                DeploymentVersion  = "1.0"
            };

            store.Create(pi);
            pi.DeploymentCategory = "DeploymentCategory2";
            store.Update(pi);
            store.Delete(pi);
            store.Dispose();
        }
Exemple #5
0
        private dynamic WebhookTrigger(dynamic o)
        {
            string secret  = o.secret;
            int    buildid = o.buildid;

            log.Debug("Received hook with secret " + secret + " for build ID " + buildid);
            if (secret != Env.WEBHOOK_SECRET)
            {
                log.Warn("Secret " + secret + " is invalid, ignoring.");
                return(HttpStatusCode.Unauthorized);
            }

            Task.Run(() =>
            {
                DeploymentStore.StartTravisDeployment(buildid);
            });

            return(HttpStatusCode.OK);
        }
Exemple #6
0
        public static void Main(string[] args)
        {
            BasicConfigurator.Configure();
            Nancy.Json.JsonSettings.MaxJsonLength = int.MaxValue;

            log.Info("Initializing...");

            // Disable ssl verification
            ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;

            if (!Kubernetes.IsKubernetes)
            {
                log.Warn("KubeDeploy cannot run without Kubernetes.");
                return;
            }

            if (!Kubernetes.CheckKubernetesConnection())
            {
                log.Warn("Kubernetes connection check failed.");
                return;
            }

            DeploymentStore.Initialize();

            var exitEvent = new ManualResetEvent(false);

            log.Debug("Initializing web host...");
            using (WebApp.Start <Startup>("http://+:8080"))
            {
                Console.CancelKeyPress += (sender, eventArgs) =>
                {
                    eventArgs.Cancel = true;
                    exitEvent.Set();
                };
                exitEvent.WaitOne();
            }
            log.Debug("Exiting...");
        }
Exemple #7
0
        public void DeploymentStoreTest()
        {
            DeploymentStore store = new DeploymentStore();

            Assert.IsNotNull(store);
        }