Пример #1
0
 function(appDeployPipelineConfig,next){
     if(appDeployPipelineConfig.length > 0){
         appDeployPipeline.updateConfigurePipeline(configurationData.projectId,configurationData,next);
     }else{
         appDeployPipeline.createNew(configurationData, next);
     }
 },
Пример #2
0
        AppDeployPipeline.getAppDeployPipeline(req.body.appDeployPipelineData.projectId, function(err, appDeployes) {
            if (err) {
                res.status(500).send(errorResponses.db.error);
                return;
            }
            if (appDeployes.length) {
                appDeployes[0].envId = req.body.appDeployPipelineData.envId;
                appDeployes[0].envSequence = req.body.appDeployPipelineData.envSequence;

                appDeployes[0].save(function(err, appDeployes) {
                    if (err) {
                        res.status(500).send("Pipeline Data Already Exist.");
                        return;
                    }
                    if (appDeployes) {
                        res.send(200, appDeployes);
                        return;
                    }
                });
            } else {
                AppDeployPipeline.createNew(req.body.appDeployPipelineData, function(err, appDeployes) {
                    if (err) {
                        res.status(500).send("Pipeline Data Already Exist.");
                        return;
                    }
                    if (appDeployes) {
                        res.send(200, appDeployes);
                        return;
                    }
                });
            }
        });